'{$STAMP BS2} '*********************************************************** '** ** '** I2C Routines for the Basic Stamp BS2 ** '** Controlling LCD02 Serial LCD Display ** '** ** '** Copyright 2004 - Devantech Ltd ** '** Commercial use of this software is prohibited ** '** Private and educational use only is permitted ** '** ** '** Written by Gerald Coe - April 2004 ** '** ** '*********************************************************** Key1 VAR Byte Key2 VAR Byte Tx CON 9 ' To Rx on LCD Rx CON 8 ' To Tx on LCD CLRSCRN CON 12 ' Clear Screen CUROFF CON 4 ' Hide Cursor SETCUR CON 2 ' set cursor position GETKEYS CON 16 ' Serial mode, Get Keys Command BAUD CON 84 ' BS2 & BS2e - 9600 - see parallax documentation 'BAUD CON 240 ' BS2sx & BS2p - 9600 - see parallax documentation Main: PAUSE 500 ' Wait for the display to go through its power up routine SEROUT Tx, BAUD, [CLRSCRN, CUROFF, " LCD02 - BS2 Serial Demonstration "] MainLoop: SEROUT Tx, BAUD, [GETKEYS] SERIN Rx, BAUD, [Key1, Key2] SEROUT Tx, BAUD, [SETCUR, 61,"Keypad ", BIN4 key2, BIN8 key1] GOTO MainLoop ' Loop forever