Sha256: 8094c8bd299d050666ef38d515f5b79c9d383b884e857454d728b3ec0274e6aa

Contents?: true

Size: 276 Bytes

Versions: 17

Compression:

Stored size: 276 Bytes

Contents

require 'artoo'

connection :sphero, :adaptor => :sphero, :port => '127.0.0.1:4560'
device :sphero, :driver => :sphero
  
work do
  @count = 1
  every(3.seconds) do
    sphero.set_color(@count % 2 == 0 ? :green : :blue)
    @count += 1
    sphero.roll 60, rand(360)
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
artoo-sphero-1.3.0 examples/sphero_color.rb
artoo-sphero-1.2.0 examples/sphero_color.rb
artoo-sphero-1.1.1 examples/sphero_color.rb
artoo-sphero-1.1.0 examples/sphero_color.rb
artoo-sphero-1.0.1 examples/sphero_color.rb
artoo-sphero-1.0.1.pre examples/sphero_color.rb
artoo-sphero-1.0.0 examples/sphero_color.rb
artoo-sphero-1.0.0.rc2 examples/sphero_color.rb
artoo-sphero-1.0.0.rc1 examples/sphero_color.rb
artoo-sphero-1.0.0.pre examples/sphero_color.rb
artoo-1.0.0.pre examples/sphero_color.rb
artoo-0.5.0 examples/sphero_color.rb
artoo-0.4.1 examples/sphero_color.rb
artoo-0.4.0 examples/sphero_color.rb
artoo-0.3.0 examples/sphero_color.rb
artoo-0.2.0 examples/sphero_color.rb
artoo-0.1.3 examples/sphero_color.rb