Created
February 5, 2019 18:08
-
-
Save jmas/d784ce4fa1f3ca8f08b6d9697191b744 to your computer and use it in GitHub Desktop.
LiquidCrystal I2C for ESP8266
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LiquidCrystal_I2C.h> | |
// Set the LCD address to 0x27 for a 16 chars and 2 line display | |
LiquidCrystal_I2C lcd(0x3F, 16, 2); | |
void setup() | |
{ | |
// initialize the LCD | |
// lcd.begin(); // Init with pin default ESP8266 or ARDUINO | |
lcd.begin(0, 2); //ESP8266-01 I2C with pin 0-SDA 2-SCL | |
// Turn on the blacklight and print a message. | |
lcd.backlight(); | |
lcd.setCursor(0, 0); | |
#if defined(ESP8266) | |
lcd.print("ESP8266"); | |
#else | |
lcd.print("ARDUINO"); | |
#endif | |
lcd.setCursor(0, 1); | |
lcd.print("Hello, world!"); | |
} | |
void loop() | |
{ | |
// Do nothing here... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment