/*****************************************************/ /* C0216CiZ.c Program for writing to Newhaven Display Character COG - I2C interface (c)2010 Curt Lagerstam - Newhaven Display International, LLC. 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. */ /*****************************************************/ #include /*****************************************************/ code char text1[]={ "NEWHAVEN Display"}; code char text2[]={ "2x16 LCD Module "}; code char text3[]={ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}; code char text4[]={ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f}; /*****************************************************/ sbit SDA = P1^0; //Serial data sbit SCL = P3^4; //Serial clock //sbit XRESET = HIGH; //RESET /*****************************************************/ const char Slave = 0x7C; const char Comsend = 0x00; const char Datasend = 0x40; const char Line2 = 0xC0; /*****************************************************/ void delay(unsigned int n) //Delay subroutine { unsigned int i,j; for (i=0;i