Sha256: 8e45bbe2f47c4aed4851001b06ee4334d6c3599cb9440ede4c71ea1ad67509ea

Contents?: true

Size: 338 Bytes

Versions: 34

Compression:

Stored size: 338 Bytes

Contents

require 'artoo'

connection :sphero, :adaptor => :sphero, :port => '127.0.0.1:4560'
device :sphero, :driver => :sphero

def contact(*args)
  @contacts ||= 0
  @contacts += 1
  puts "Contact #{@contacts}"
end

work do
  on sphero, :collision => :contact

  every(3.seconds) do
    puts "Rolling..."
    sphero.roll 90, rand(360)
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
artoo-1.6.7 examples/sphero_messages.rb
artoo-1.6.6 examples/sphero_messages.rb
artoo-1.6.5 examples/sphero_messages.rb
artoo-1.6.4 examples/sphero_messages.rb
artoo-1.6.3 examples/sphero_messages.rb
artoo-1.6.2 examples/sphero_messages.rb
artoo-1.6.1 examples/sphero_messages.rb
artoo-sphero-1.3.0 examples/sphero_messages.rb
artoo-1.6.0 examples/sphero_messages.rb
artoo-1.5.0 examples/sphero_messages.rb
artoo-sphero-1.2.0 examples/sphero_messages.rb
artoo-1.4.1 examples/sphero_messages.rb
artoo-1.4.0 examples/sphero_messages.rb
artoo-1.3.0 examples/sphero_messages.rb
artoo-sphero-1.1.1 examples/sphero_messages.rb
artoo-1.2.2 examples/sphero_messages.rb
artoo-sphero-1.1.0 examples/sphero_messages.rb
artoo-1.2.1 examples/sphero_messages.rb
artoo-1.2.0 examples/sphero_messages.rb
artoo-1.1.1 examples/sphero_messages.rb