Skip to content

Instantly share code, notes, and snippets.

@jmas
Created February 5, 2019 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmas/d784ce4fa1f3ca8f08b6d9697191b744 to your computer and use it in GitHub Desktop.
Save jmas/d784ce4fa1f3ca8f08b6d9697191b744 to your computer and use it in GitHub Desktop.
LiquidCrystal I2C for ESP8266
#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