WeMOS: D1 R1 mini LCD I2C PCF8574 Hello World

From OnnoWiki
Jump to navigation Jump to search
// This example shows various featues of the library for LCD with 16 chars and 2 lines.
// Library https://github.com/mathertel/LiquidCrystal_PCF8574

#include <Arduino.h>
#include <Wire.h>
#include <LiquidCrystal_PCF8574.h>

LiquidCrystal_PCF8574 lcd(0x27);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup() {
  Serial.begin(115200);
  Wire.begin();
  Wire.beginTransmission(0x27);
  lcd.begin(16, 2);  // initialize the lcd
}

void loop() {
  lcd.setBacklight(255);
  lcd.home();
  lcd.clear();
  lcd.noBlink();
  lcd.noCursor();
  lcd.setCursor(0,1);
  lcd.print("Hello World!");
  delay(3000);
}