Class: RapiroWrapper::LeftSholderRoll

Inherits:
ServoMotor
  • Object
show all
Defined in:
lib/rapiro_wrapper/servo_motor/left_sholder_roll.rb

Overview

LeftSholderRoll for RAPIRO

Constant Summary collapse

NO =
5
DEFAULT =
180
MIN =
0
MAX =
180

Instance Method Summary collapse

Methods inherited from ServoMotor

code, find_servos, #to_code

Constructor Details

#initialize(up: nil) ⇒ LeftSholderRoll

Returns a new instance of LeftSholderRoll.



9
10
11
12
13
14
15
16
# File 'lib/rapiro_wrapper/servo_motor/left_sholder_roll.rb', line 9

def initialize(up: nil)
  if up
    @value = MAX - up
  else
    @value = DEFAULT
  end
  fail ArgumentError unless @value.between?(MIN, MAX)
end