/* I2C Serial Interface LCD Module Display Sample code */ #include // Get the LCD I2C Library here: // https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads // Move any other LCD libraries to another folder or delete them // See Library "Docs" folder for possible commands etc. #include // set the LCD address to 0x27 for a 16 chars 2 line display // A FEW use address 0x3F // Set the pins on the I2C chip used for LCD connections: // addr, en,rw,rs,d4,d5,d6,d7,bl,blpol LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address void setup(){ Serial.begin(9600); lcd.begin(16,2); // initialize the lcd for 16 chars 2 lines, turn on backlight for(int i = 0; i< 3; i++) { lcd.backlight(); delay(250); lcd.noBacklight(); delay(250); } lcd.backlight(); lcd.setCursor(0,0); //Start at character 4 on line 0 lcd.print("Hello, world!"); delay(1000); lcd.setCursor(0,1); lcd.print("I2C Module Disp"); delay(8000); lcd.clear(); lcd.setCursor(0,0); //Start at character 0 on line 0 lcd.print("Use Serial Mon"); lcd.setCursor(0,1); lcd.print("Type to display"); } void loop() { { if (Serial.available()) { delay(100); lcd.clear(); while (Serial.available() > 0) { lcd.write(Serial.read()); } } } }