Class: Artoo::Drivers::ContinuousServo
- Inherits:
-
Driver
- Object
- Driver
- Artoo::Drivers::ContinuousServo
- Defined in:
- lib/artoo/drivers/continuous_servo.rb
Overview
ContinuousServo behaviors for Firmata
Constant Summary collapse
- COMMANDS =
[:clockwise, :counter_clockwise, :stop].freeze
Instance Method Summary collapse
-
#clockwise ⇒ Object
Turns the servo clockwise.
-
#counter_clockwise ⇒ Object
Turns the servo counter clockwise.
-
#initialize(params = {}) ⇒ ContinuousServo
constructor
Create new ContinuousServo.
-
#stop ⇒ Object
Stops the driver.
Constructor Details
#initialize(params = {}) ⇒ ContinuousServo
Create new ContinuousServo
10 11 12 |
# File 'lib/artoo/drivers/continuous_servo.rb', line 10 def initialize(params={}) super end |
Instance Method Details
#clockwise ⇒ Object
Turns the servo clockwise
20 21 22 |
# File 'lib/artoo/drivers/continuous_servo.rb', line 20 def clockwise connection.servo_write(pin, 180) end |
#counter_clockwise ⇒ Object
Turns the servo counter clockwise
25 26 27 |
# File 'lib/artoo/drivers/continuous_servo.rb', line 25 def counter_clockwise connection.servo_write(pin, 89) end |
#stop ⇒ Object
Stops the driver
15 16 17 |
# File 'lib/artoo/drivers/continuous_servo.rb', line 15 def stop connection.servo_write(pin, 90) end |