Hi, I would like to turn an led on & off 20 times then it to remain off after the 20th time through the loop.
I am not sure what i am missing but hopefully a simple solution to the code.
hope some one can help.
i have attached the code.
const int ledPin =13;
int delayPeriod = 100;
int count =0;
void setup() {
pinMode (ledPin, OUTPUT);
}
void loop()
{
digitalWrite (ledPin, HIGH);
delay (delayPeriod);
digitalWrite (ledPin, LOW);
delay (delayPeriod);
count ++;
if (count == 20)
{
digitalWrite (ledPin, LOW);
}
}