int pinLED = 3;
int pinBUTTON = 2;
void setup() {
Serial.begin(9600);
pinMode(pinLED, OUTPUT);
pinMode(pinBUTTON, INPUT);
Serial.println("Program siap dimulai");
}
void loop() {
if (digitalRead(pinBUTTON) == LOW) {
digitalWrite(pinLED, HIGH);
Serial.println("LED menyala");
}
else {
digitalWrite(pinLED, LOW);
Serial.println("LED mati");
}
}