/*
Project: LCD Demo
Description: Basic connections and setups for
parallel and I2c LCD displays.
Creation date: 7/3/23
Author: AnonEngineering
*/
// for this demo, include libraries for both types of LCD
#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
// pin constants for the parallel LCD
const int RS = 12, EN = 11, D4 = 10, D5 = 9, D6 = 8, D7 = 7;
// create a parallel LCD object called "lcd"
LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
// create an I2C LCD object called "lcdI2C"
LiquidCrystal_I2C lcdI2C(0x27, 16, 2);
void setup() {
// start serial
Serial.begin(115200);
// start parallel LCD
lcd.begin(16, 2);
// start I2C LCD
lcdI2C.init();
// turn on the I2C LCD backlight
lcdI2C.backlight();
// start up message on parallel LCD
lcd.setCursor(2, 0);
lcd.print("Parallel LCD");
lcd.setCursor(1, 1);
lcd.print("Uses 6 uC pins");
// start up message on I2C LCD
lcdI2C.setCursor(4, 0);
lcdI2C.print("I2C LCD");
lcdI2C.setCursor(1, 1);
lcdI2C.print("Uses 2 uC pins");
//delay(2000);
//lcdI2C.noBacklight();
}
void loop() {
// nothing to loop about...
}