int tombol_2;
int tombol_3;
int tombol_4;
int tombol_5;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
tombol_2 = digitalRead(2);
tombol_3 = digitalRead(3);
tombol_4 = digitalRead(4);
tombol_5 = digitalRead(5);
if (tombol_2 == 0){
Serial.println(1);
} else if (tombol_3 == 0){
Serial.println(2);
} else if (tombol_4 == 0){
Serial.println(3);
} else if (tombol_5 == 0){
Serial.println(4);
} else {
Serial.println(5);
}
}