Sha256: 7555e237cf9f58c87e8cc030a85ce638906a2c05e0987e1e61e89d59db5bef87
Contents?: true
Size: 820 Bytes
Versions: 3
Compression:
Stored size: 820 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 connection :pebble, :adaptor => :pebble device :watch, :driver => :pebble, :name => 'pebble' api :host => '0.0.0.0', :port => '8080' name 'pebble' def move_forward p 'moving forward' sphero.roll 100, 0 sleep 4 sphero.stop end def move_backward p 'moving backward' sphero.roll 100, 180 sleep 4 sphero.stop end def button_push(*data) unless data[1].nil? case data[1] when 'up' then move_forward when 'select' then sphero.set_color(rand(255),rand(255),rand(255)) when 'down' then move_backward end end end work do on pebble, :button => :button_push end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
artoo-sphero-1.5.1 | examples/sphero_pebble.rb |
artoo-sphero-1.5.0 | examples/sphero_pebble.rb |
artoo-sphero-1.4.0 | examples/sphero_pebble.rb |