Examples of Arduino program here that has just been posted here. Simplified the program by adding a loop instruction that is: for ().
Because the digital pin to 8led is D2 .. D9, then the instruction pinMode (), digitalWrite, and delay () can be inserted into the looping of for() instruction.
More programs like the following:
Program can be explained as follow:
- On setup(), using looping for() defined n variables as series 2,3,4,5,6,7,8,9. thus, Inside looping of for(), function of pinMode() and digitalWrite() instructions executed for pin of digital as number of 2,3,4,5,6,7,8,9.
- Inside function of loop(), each led of digital pin turn on about 100ms. Thus do not need to write down instructions repeatedly, for each LED.
Once the compiled binary code becomes smaller when compared to the previous tutorial.
Having executed the same result as the following video.
Source can be downloaded here.
Last updated byat .