#include <LiquidCrystal_I2C.h>
#define LDR 26
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
// put your setup code here, to run once:
//if(!i2CAddrTest(0x27)){
//LicuiCrystal_I2C lcd(0x3F, 16, 2);
// }
lcd.init();
lcd.backlight(); //el back light es la luz o un led para mejor calidad
lcd.setCursor(3,0); //Imprime el eje
lcd.print("Valor LDR"); // imprime la palabra
pinMode(LDR, INPUT);
}
void loop() {
int value = analogRead(LDR);
lcd.setCursor(5,1);
lcd.print(value);
delay(1);
// put your main code here, to run repeatedly:
delay(100); // this speeds up the simulation
}