/* Project: LCD2004 I2C module Function: Dispalys symbols and text Compatible with the Arduino IDE 1.0 */ //*********************************************************** #include //include library code //********************************************************* #if defined(ARDUINO) && ARDUINO >= 100 #define printByte(args) write(args); #else #define printByte(args) print(args,BYTE); #endif uint8_t heart[8] = {0x0, 0xa, 0x1f, 0x1f, 0xe, 0x4, 0x0};//symbol heart LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);//initialise the LCD 2004 I2C void setup() { lcd.begin (20, 4);//define the LCD as 20 column by 4 rows //switch on the backlight lcd.setBacklightPin(3, POSITIVE); lcd.setBacklight(HIGH); lcd.createChar(3, heart); lcd.setCursor(0, 0);//sets the cursor to 1 row 1 column for (int i = 0; i < 20; i++) lcd.printByte(3);//prints symbol lcd.setCursor(0, 1);//sets cursor to 2 row 1 column lcd.printByte(3);//prints symbol lcd.print(" Welcome to ");//prints message lcd.printByte(3);//prints symbol lcd.setCursor(0, 2);//sets cursor to 3 row 1 column lcd.printByte(3);//prints symbol lcd.print(" ACOPTEX.COM !!! ");//prints message lcd.printByte(3);//prints symbol lcd.setCursor(0, 3);//sets cursor to 4 row 1 column for (int i = 0; i < 20; i++) lcd.printByte(3);//prints symbol delay (3000);//sets delay for 3 seconds lcd.clear();//clears the screen } void loop() { }