Class: RapiroWrapper::RightSholderPitch

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

Overview

RightSholderPitch class for RAPIRO

Constant Summary collapse

NO =
3
DEFAULT =
130
MIN =
40
MAX =
130

Instance Method Summary collapse

Methods inherited from ServoMotor

code, find_servos, #to_code

Constructor Details

#initialize(up: nil) ⇒ RightSholderPitch

Returns a new instance of RightSholderPitch.



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

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