const int tombol1 = 2;
const int tombol2 = 3;
const int tombol3 = 4;
const int tombol4 = 5;
const int lampu1 = 8;
const int lampu2 = 9;
const int lampu3 = 10;
const int lampu4 = 11;
void setup() {
pinMode(tombol1, INPUT);
pinMode(tombol2, INPUT);
pinMode(tombol3, INPUT);
pinMode(tombol4, INPUT);
pinMode(lampu1, OUTPUT);
pinMode(lampu2, OUTPUT);
pinMode(lampu3, OUTPUT);
pinMode(lampu4, OUTPUT);
digitalWrite(tombol1, HIGH);
digitalWrite(tombol2, HIGH);
digitalWrite(tombol3, HIGH);
digitalWrite(tombol4, HIGH);
}
void loop() {
if(digitalRead(tombol1)==LOW){
digitalWrite(lampu1, HIGH);
}else{
digitalWrite(lampu1, LOW);
}
if(digitalRead(tombol2)==LOW){
digitalWrite(lampu2, HIGH);
}else{
digitalWrite(lampu2, LOW);
}
if(digitalRead(tombol3)==LOW){
digitalWrite(lampu3, HIGH);
}else{
digitalWrite(lampu3, LOW);
}
if(digitalRead(tombol4)==LOW){
digitalWrite(lampu4, HIGH);
}else{
digitalWrite(lampu4, LOW);
}
}