while
while
loop
An expression is evaluated and as long as it is true
, the block within the while
statement will be executed.
Here is an example:
import lib
vcc = supply("VCC")
gnd = dgnd()
at vcc
wire right 100
counter = 0
while counter < 5:
add led("yellow")
wire right 100
counter += 1
add res(10k)
wire right 100 down 100
to gnd