Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Last active December 12, 2015 03:08
Show Gist options
  • Select an option

  • Save deadprogram/4704472 to your computer and use it in GitHub Desktop.

Select an option

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