Class: Artoo::Interfaces::Sphero

Inherits:
Rover
  • Object
show all
Defined in:
lib/artoo/interfaces/sphero.rb

Overview

The Sphero Rover interface

Instance Method Summary collapse

Instance Method Details

#backward(speed) ⇒ Object



11
12
13
# File 'lib/artoo/interfaces/sphero.rb', line 11

def backward(speed)
  @device.roll 180, speed
end

#forward(speed) ⇒ Object



7
8
9
# File 'lib/artoo/interfaces/sphero.rb', line 7

def forward(speed)
  @device.roll 0, speed
end

#left(speed) ⇒ Object



15
16
17
# File 'lib/artoo/interfaces/sphero.rb', line 15

def left(speed)
  @device.roll 270, speed
end

#right(speed) ⇒ Object



19
20
21
# File 'lib/artoo/interfaces/sphero.rb', line 19

def right(speed)
  @device.roll 90, speed
end

#stopObject



31
32
33
# File 'lib/artoo/interfaces/sphero.rb', line 31

def stop
  @device.stop
end

#turn_left(degrees) ⇒ Object



23
24
25
# File 'lib/artoo/interfaces/sphero.rb', line 23

def turn_left(degrees)
  # TODO: implement
end

#turn_right(degrees) ⇒ Object



27
28
29
# File 'lib/artoo/interfaces/sphero.rb', line 27

def turn_right(degrees)
  # TODO: implement
end