const int BUTTON_1_PIN = 27;
const int BUTTON_2_PIN = 26;
void setup() {
Serial.begin(115200);
pinMode(BUTTON_1_PIN, INPUT);
pinMode(BUTTON_2_PIN, INPUT);
}
void loop() {
delay(10); // this speeds up the simulation
Serial.print("Button 1 state: ");
Serial.println(digitalRead(BUTTON_1_PIN) ? "HIGH" : "LOW");
Serial.print("Button 2 state: ");
Serial.println(digitalRead(BUTTON_2_PIN) ? "HIGH" : "LOW");
Serial.println();
delay(2000);
}
Button 1
Pulled Up
Button 2
Pulled Down