Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
P1 -> propeller(:motor)
P2 -> led
P3, P4 <-> xbee(:serial)
P6 <- button(:button)
P7 <- thermometer(:analog)
when button.pushed
led.off
end
when thermometer.read > 100
xbee.send "It is very hot!"
led.on
end
for xbee.receive_commands
led.on
when 'action'
if direction == :forward
direction = :back
else
direction = :forward
end
propeller.turn(direction, 50)
when 'camera'
xbee.send "I have no camera"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment