elkhart.195 / elkhart.195.ino
antitheft159's picture
Upload elkhart.195.ino
d2b0987 verified
raw
history blame contribute delete
No virus
595 Bytes
#include <TimerOne.h>
String LEDStatus="OFF";
int YellowLED=10;
int RedLED=9;
void setup() {
// put your setup code here, to run once:
pinMode(YellowLED,OUTPUT);
pinMode(RedLED,OUTPUT);
Timer1.initialize(1000000);
Timer2.attachinterrupt ( BlinkYellow);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(RedLED,HIGH);
delay(250);
digitalWrite(RedLED,LOW);
delay(250);
}
void BlinkYellow()
{
if(LEDStatus=="ON"){
digitalWrite(YellowLED,LOW);
LEDStatus="OFF";
return;
}
if(LEDStatus=="OFF"){
digitalWrite(YellowLED,HIGH);
}
}