Loops
Loops provides blocks that enable you to repeatedly execute a set of instructions, making your programs more efficient and powerful. Instead of manually duplicating code for each iteration, you can use loops to:
Process multiple sensor readings
Generate patterns for LED displays
Handle collections of data
Create sequences of operations
repeat

Executes code a specific number of times.
Parameters:
Count (Number): How many times to repeat
Example:

repeat while

Repeats code as long as a condition is true.
Parameters:
Condition (Boolean): The condition to check
Example:

repeat until

Repeats code until a condition becomes true.
Parameters:
Condition (Boolean): The condition to check
Example:

iterator

Returns the current loop iteration number (0-based).
Returns:
Iterator (Number): The current loop iteration number
Example:

An iterator can not be used outside the loop.
Last updated