Output Using MSW Logo - 3
Flashing LEDs and the WAIT command

If you write a procedure to turn the LEDs ON and OFF without using a delay between each command, everything will happen so fast that you won't see thre LEDs flash. The delay command in MSW Logo is: WAIT <milli seconds> eg WAIT 1000 will result in a one second delay.

A typical procedure to cause the LEDs to 'flash' would be:
to flash
outportb 888 1
wait 100
outportb 888 2
wait 100
outportb 888 4
wait 100
outportb 888 8
wait 100
outportb 888 16
wait 100
outportb 888 32
wait 100
outportb 888 64
wait 100
outportb 888 128
wait 100
end

You could turn this into a 'ripple' with:
to ripple
repeat 50 [flash]
end

<- Back -Menu-