Pause

Pause the program for the number of milliseconds you say. You can use this function to slow your program down.

basic.pause(400)

Parameters

Example: diagonal line

This example draws a diagonal line by turning on LED 0, 0 (top left) through LED 4, 4 (bottom right). The program pauses 500 milliseconds after turning on each LED. Without pause, the program would run so fast that you would not have time to see each LED turning on.

for (let i = 0; i < 5; i++) {
    led.plot(i, i)
    basic.pause(500)
}

See also

while, running time, for

Edit this page on GitHub