This is how I controlled my sumo bot using a leap motion.
You need to have:
- Only tried on OS X Mavericks
- StandardFirmata flashed on your Arduino Uno
- Leap Motion installed on your computer
I connected the left servo to pin 3 and the right servo to pin 9. Any PWM pins will do but you will need to adjust servo.rb accordingly
Connect the Leap Motion and Arduino to your computer via USB.
Install gem dependencies
$ bundle install
Before you plug in your Arduino run
$ artoo connect scan
Then after you plug in your Arduino run the same command again and look for a new entry. This will be the device file to reference at the top of servo.rb
$ ruby leap.rb | ruby servo.rb
The direction of the bot is controlled by the tilt of your palm.
Tilt your palm forward and the bot moves forward.
Tilf your palm to the left and the bot turns left.