#include <LiquidCrystal_I2C.h>
#define LDR_PIN 2
int led=13;
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
pinMode(LDR_PIN, INPUT);
pinMode(led, OUTPUT);
lcd.init();
lcd.backlight();
}
void loop() {
lcd.setCursor(2, 0);
lcd.print("Room: ");
if (digitalRead(LDR_PIN) == LOW) {
lcd.print("Light!");
digitalWrite(led,HIGH);
} else {
lcd.print("Dark ");
digitalWrite(led,LOW);
}
delay(100);
}