#define switchPin 13
boolean running = false;
int LedPin =4;
void setup() {
// put your setup code here, to run once:
pinMode(switchPin, INPUT);
Serial.begin (9600);
pinMode(LedPin, OUTPUT);
digitalWrite(switchPin,HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(switchPin) == LOW){
delay(100);
running =!running;
digitalWrite(LedPin,running);
}
Serial.println(digitalRead(switchPin));
delay(1000);
}