Sha256: db29eb65fa6c0e806166abed8c000a536b8fda41b788379eb0cdfa3c0cc3ae80

Contents?: true

Size: 408 Bytes

Versions: 1

Compression:

Stored size: 408 Bytes

Contents

require 'artoo'

connection :sphero, :adaptor => :sphero, :port => '/dev/rfcomm0' #linux
#connection :sphero, :adaptor => :sphero, :port => '127.0.0.1:4567'

device :sphero, :driver => :sphero

work do
  @rolling = false

  every(3.seconds) do
    puts "Rolling..."
    unless @rolling
      sphero.roll 90, rand(360)
      @rolling = true
    else
      sphero.stop
      @rolling = false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
artoo-sphero-1.4.0 examples/sphero.rb