EasyManua.ls Logo

Eckstein komponente KS0530 - Page 94

Default Icon
160 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
94
(6) Code Explanation
When we need to repeat some statements, we could use FOR statement.
FOR statement format is shown below:
FOR cyclic sequence:
Round 11 2 3 4
Round 22 3 4
...
Until number 2 is not established, forloop is over,
After knowing this order, go back to code:
for (int value = 0; value < 255; value=value+1){
...}
for (int value = 255; value >0; value=value-1){
...}
The twoforstatements make value increase from 0 to 255, then reduce
from 255 to 0, then increase to 255,....infinitely loop
There is a new function in the following ----- analogWrite()