#define LED_1 12
#define Button 14
int Status = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Rangkaian LED + Button");
pinMode(LED_1, OUTPUT);
pinMode(Button, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Status = digitalRead(Button);
if(Status == HIGH) {
digitalWrite(LED_1, HIGH);
Serial.println("LED 1 Menyala");
}
else {
digitalWrite(LED_1, LOW);
Serial.println("LED 1 Mati");
}
delay(1000);
}