#include <LiquidCrystal_I2C.h>
const int pinled = 7;
const int pinpb = 3;
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.begin(20, 4);
lcd.backlight();
pinMode(pinled, OUTPUT);
pinMode(pinpb, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(pinpb) == HIGH) {
digitalWrite(pinled, HIGH);
delay(500);
digitalWrite(pinled, LOW);
delay(500);
lcd.setCursor(0, 0);
lcd.print("menyala");
delay(1000);
} else {
digitalWrite(pinled, LOW);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("modar");
delay(1000);
}
}