Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

Programming Arduino (1) Pages 64

Uploaded by

axl1994
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Programming Arduino (1) Pages 64

Uploaded by

axl1994
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

delay(delayPeriod);

digitalWrite(ledPin, LOW);

delay(delayPeriod);

count ++;

if (count == 20)

count = 0;

delay(3000);

You may have noticed the following line:


count ++;

This is just C shorthand for the following:


count = count + 1;

So now each time that loop is run, it will take just a bit more than 200
milliseconds, unless it’s the 20th time round the loop, in which case it will take
the same plus the three seconds delay between each batch of 20 flashes. In fact,
for some applications, even this is too slow, and purists would say that you
should not use delay at all. The best solution depends on the application.

while

You might also like