#include <LiquidCrystal_I2C.h>
#define LDR 26
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print(("Valor LDR = "));
pinMode(LDR, INPUT);
}
void loop() {
lcd.setCursor(0,1);
int adcval = analogRead(LDR);
lcd.print(adcval);
// put your main code here, to run repeatedly:
delay(100); // this speeds up the simulation
}
Loading
pi-pico-w
pi-pico-w