boolean OldStatus, FlashEnable, FlashBit;
long OldTime;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
pinMode(4, INPUT);
OldTime=millis();
}
// the loop function runs over and over again forever
void loop() {
if(digitalRead(4)&!OldStatus){
FlashEnable=!FlashEnable;
}
OldStatus=digitalRead(4);
if(millis() - OldTime >200){
FlashBit=!FlashBit;
OldTime=millis();
}
if(FlashEnable){
if(FlashBit){
digitalWrite(13, HIGH);
}else digitalWrite(13, LOW);
}else digitalWrite(13, LOW);
}