Wednesday, November 21, 2007

Two switches and the if command

Look here for the reason for these Logo posts.

Setup: Connect one motor to port A and one lamp to port B. Connect one switch to port 1 and another switch to port 2. Download and run this program:

to start
loop [flash-and-spin]
end

to flash-and-spin
if switch1
[aon]
if not switch1
[aoff]
if switch2
[bon]
if not switch2
[boff]
end

No comments :