Skip to content

Instantly share code, notes, and snippets.

@cowboyd
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cowboyd/06f33f27a50dea1e8813 to your computer and use it in GitHub Desktop.
Save cowboyd/06f33f27a50dea1e8813 to your computer and use it in GitHub Desktop.
class DemoBot < BrickPi::Bot
motor :port_A
motor :port_B
property :forward_speed do |value|
motor_A.spin value
motor_B.spin value
end
property :rotation_speed do |value|
motor_A.spin = -1 * value
motor_B.spin = value
end
end
bot = DemoBot.new
bot.forward_speed = 20
bot.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment