I2C LCD arduino code
Download the .zip file below. Unzip it and open it in Arduino IDE. Compile and upload.
Download the LiquidCrystal_I2C library .zip file below. Install it on your Arduino IDE.
/*
LCD i2c test
http://www.electronoobs.com
http://www.youtube.com/c/ELECTRONOOBS
*/
//LCD config
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3f,20,4); //sometimes the adress is not 0x3f. Change to 0x27 if it dosn't work.
void setup() {
lcd.init();
lcd.backlight();
}
void loop() {
lcd.clear();
lcd.setCursor(2,0);
lcd.print("ELECTRONOOBS");
lcd.setCursor(2,1);
lcd.print("hello world");
delay(3000);
}//end void