int button = 25; // the number of the pushbutton pin
int led = 26; // the number of the LED pin
// variable for storing the pushbutton status
//int buttonState = 0;
void setup() {
Serial.begin(115200);
// initialize the pushbutton pin as an input
pinMode(button, INPUT);
// initialize the LED pin as an output
pinMode(led, OUTPUT);
}
void loop() {
// read the state of the pushbutton value
int buttonState = digitalRead(button);
Serial.println(buttonState);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH
if (buttonState == HIGH) {
// turn LED on
digitalWrite(led, 1);
} else {
// turn LED off
digitalWrite(led,0);
}
}