- This topic has 1 reply, 2 voices, and was last updated 9 years, 5 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › Arduino › arduino LED blink without delay
hello,
i have tried new code…using without delay…i think this is my code is right but still LED not blinking….plz help me to remove bug in my this code..
#blink LED with 2 sec delay
_________________________________________________________________
int led=13,ledstate;
int previous=0;
int interval=2000;
void setup()
{
pinMode(led,,OUTPUT);
}
void loop
{
int current=millis();
if(current – previous>=interval)
{
previous=current;
digitalWrite(led,HIGH);
}
else
{
digitalWrite(led,LOW);
}}}
}