Last active
December 12, 2015 03:08
-
-
Save deadprogram/4704472 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| require 'artoo/robot' | |
| SPHEROS = ["4567", | |
| "4568", | |
| "4569", | |
| "4570", | |
| "4571"] | |
| class SpheroRobot < Artoo::Robot | |
| connection :sphero, :adaptor => :sphero | |
| device :sphero | |
| work do | |
| every(3.seconds) do | |
| sphero.roll 90, rand(360) | |
| end | |
| end | |
| end | |
| robots = [] | |
| SPHEROS.each {|p| | |
| robots << SpheroRobot.new(:connections => | |
| {:sphero => | |
| {:port => p}}) | |
| } | |
| SpheroRobot.work!(robots) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment