The for loop
is a really useful structure for repeating something many times quickly, or iterating over a list of things, but it doesn't do much good if you want to repeat something more slowly. For cases when you want to control how quickly the repetition happens, you'll want a Timed Loop.
A Timed Loop is actually composed of two blocks:
The timedLoop()
block, which takes two inputs:
The stopTimedLoop()
block which stops all timed loops that are running.
stopTimedLoop()
block tells all running Timed Loops to stop running. Note that when stopTimedLoop()
is called, the timed loop won't necessarily quit immediately, it just won't repeat next time.Found a bug in the documentation? Let us know at documentation@code.org