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