This block repeats the blocks housed inside it as many times as the loop parameter set in its head. This block is often used to repeat an action (or a set of actions) infinitely by setting the loop parameter to infinity.
You can set the number of repetitions for the blocks inside Loop. The number of repetitions can be set from 1 to 99, besides a value of infinity (Loop (forever)
A useful application of this block is when you want the project to run continuously from the time it is uploaded to the board till the board is turned off or a new code is uploaded to the board.
In the absence of this block, the code will run only at the instant of upload and hence its execution may not be observable.
The below project will run once at the time of the upload.
At the instant the project is uploaded to the board, the LED will turn orange and then turn off after a delay of 500 milliseconds. It will then continue to remain off.
However, in the example below, if the same blocks are housed inside a Loop infinitely block, the LED will continue to blink orange and off with a delay of 500 milliseconds between them.