'{$STAMP BS2p} '*********************************************************** '** ** '** I2C Routines for the Basic Stamp BS2p ** '** Controlling LCD02 I2C 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 SCL CON 9 ' I2C clock SDA CON 8 ' I2C data CLRSCRN CON 12 ' Clear Screen CUROFF CON 4 ' Hide Cursor SETCUR CON 2 ' set cursor position Main: PAUSE 500 ' Wait for the display to go through its power up routine I2COUT SDA, $c6, 0, [CLRSCRN, CUROFF, " LCD02 - BS2p I2C Demonstration "] MainLoop: I2CIN SDA, $c6, 1, [Key1, Key2] I2COUT SDA, $c6, 0, [SETCUR, 60," Keypad ", BIN4 key2, BIN8 key1] GOTO MainLoop ' Loop forever