#define led 12
#define button 10
int sw, c=0;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(button, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
sw=digitalRead(button);
if (sw==0)
{
delay(250);
c++;
Serial.println("on");
digitalWrite(led,c%2);
}
else
{
Serial.println("off");
}
}