// oNMDLCD.osc // // LCD driver routines for the Milford Instruments 2x16 character serial LCD // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Contributors: // Neil Durant oSerialX LCD = new oSerialX; byte delay; Sub void main(void) { LCD.Baud = cv2400; LCD.IOLineS = 27; // OOPIC pin that connects to the LCD module serial pin LCD.IOLinef = 27; // As above LCD.InvertS = cvTrue; LCD.Operate = cvTrue; } Sub void ClearScreen(void) { LCD.Value = 254; LCD.Value = 1; // 12ms delay // We need to do delays using a loop because the OOPIC // cannot support the "OOPIC.Delay =" method within // user class definitions for(delay = 0; delay < 1; delay++) { } } Sub void MoveTo(byte aLine, byte aCol) { byte offset; offset = 128; if(aLine == 1) { offset = 192; } offset = offset + aCol; LCD.Value = 254; LCD.Value = offset; // 12ms delay for(delay = 0; delay < 1; delay++) { } } // End of nmdLCD.osc