When designing a sketch, you’ll often repeat the same function. You could
simply copy and paste the function to duplicate it in a sketch, but that’s inefficient
and a waste of your Arduino’s program memory. Instead, you can
use for loops. The benefit of using a for loop is that you can determine how
many times the code inside the loop will repeat.
To see how a for loop works, enter the following code as a new sketch: