16x2 LCD 4隻腳位
GND
3v
SDA GPIO21
SCL GPIO22
#include <Wire.h>
#include "LiquidCrystal_I2C.h"
//LiquidCrystal_I2C lcd(0x27); // Set the LCD I2C address
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7);
void setup()
{
Serial.begin(115200);
lcd.begin (16,2); // for 16 x 2 LCD module
lcd.setBacklightPin(3,POSITIVE);
lcd.setBacklight(HIGH);
}
void loop()
{
lcd.home ();
lcd.print("Hello, ESP32");
lcd.setCursor ( 0, 1 );
lcd.print (" by Ghosty ");
delay ( 1000 );
}