Step 1 - Build the Project
The "while" loop iterates ,or counts through, one or more commands. The loop will repeat until a condition is met that makes it break; it runs until something stops it from running.
Note: If you're uploading this project directly from the website, first click Run on Arduino, complete the upload, then scroll down and click the Connect button in the Serial Monitor. This allows the data to be sent from the Maker Board to the Serial Monitor.
Step 2 - Upload the Code
Step 3 - Read the Walkthrough
A “while” loop iterates until the condition between the parentheses is false.
This statement is most useful when you're not sure what values will be in the condition. You can create a “while” loop to run forever if you want.
In this code, the byte variable is declared with a value of 0, so the "while" loop will count up to 10 from 0. If the value of i started as 5, the "while" loop would run up to 10 from 5.
Now no matter what the value of i was when the “while” loop started, it will increase by one each time the “while” loop runs until i isn't less than 10.