int button_1 =15;
int button_2 =2;
void setup() {
Serial.begin(9600);
//Initialize the digital pins as inputs
pinMode(button_1, INPUT);
pinMode(button_2, INPUT);
}
void loop() {
//Read the states of push button values
int buttonstate_1 = digitalRead(button_1);
int buttonstate_2 = digitalRead(button_2);
//active low
if(buttonstate_1 == LOW){
Serial.println("Button 1 is pressed");
delay(500);
}
//active high
if(buttonstate_2 == HIGH){
Serial.println("Button 2 is pressed");
delay(500);
}
}