#ifndef LCDI2C4BIT_H #define LCDI2C4BIT_H #include // helpful position constants; lets us put our cursor at start of lines (or add offset, up to 16/20 chars) #define LCD_CURS_POS_L1_HOME 0x80 #define LCD_CURS_POS_L2_HOME 0xC0 #define LCD_CURS_POS_L3_HOME 0x94 #define LCD_CURS_POS_L4_HOME 0xD4 //command bytes for LCD #define CMD_CLR 0x01 #define CMD_RIGHT 0x1C #define CMD_LEFT 0x18 #define CMD_HOME 0x02 // IMPORTANT! Wire. must have a begin() before calling init() class LCDI2C4Bit { public: LCDI2C4Bit( uint8_t devI2CAddress, uint8_t num_lines, uint8_t lcdwidth, uint8_t backlightPin ); void init(); void command( uint8_t ); void write( uint8_t ); void print( char value[] ); void clear(); void backLight( uint8_t ); void SendToLCD( uint8_t ); void WriteLCDByte( uint8_t bdata ); void SetMCPReg( uint8_t, uint8_t ); void cursorTo( uint8_t line_num, uint8_t x ); private: uint8_t myNumLines; uint8_t myWidth; uint8_t myAddress; uint8_t myBacklightPin; uint8_t lcd_i2c_address; uint8_t dataPlusMask; }; #endif