#define led_red 13
#define pb_1 12
boolean last_stat = HIGH;
boolean current_stat = HIGH;
boolean led_stat = LOW;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(led_red, OUTPUT);
pinMode(pb_1, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
current_stat = digitalRead(pb_1);
if(current_stat == LOW && last_stat == HIGH){
led_stat = !led_stat;
digitalWrite(led_red, led_stat);
}
last_stat = current_stat;
delay(10);
}