#include const int led = 15; const int button = 2; int led_status = 0; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(led,OUTPUT); pinMode(button,INPUT); //digitalWrite(led,HIGH); Serial.println("all system go"); } void loop() { // put your main code here, to run repeatedly: if(digitalRead(button) == LOW){ led_status = led_status+1; Serial.println(led_status); } if(led_status%2 == 1) { digitalWrite(led,LOW); } if(led_status%2 == 0) { digitalWrite(led,HIGH); } delay(10); }