Skip to content

Instantly share code, notes, and snippets.

@atduskgreg
Forked from deadprogram/gist:274950
Created January 12, 2010 06:21
Show Gist options
  • Select an option

  • Save atduskgreg/274959 to your computer and use it in GitHub Desktop.

Select an option

Save atduskgreg/274959 to your computer and use it in GitHub Desktop.
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