break
break
When this is used within a loop (while
or for
), it will stop further execution of the loop.
Example:
import lib
vcc = supply("VCC")
gnd = dgnd()
at vcc
wire right 100
counter = 0
# Loop through an array of colors
while true:
add led("yellow")
wire right 100
counter += 1
# once this condition is reached, then stop the loop
if counter > 4:
break
add res(10k)
wire right 100 down 100
to gnd
break
within circuit paths
If break
is used within a branch
command, it will stop further execution within that branch
and return to the original branch
location.