Last active
August 29, 2015 14:06
-
-
Save cowboyd/06f33f27a50dea1e8813 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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