Class: RapiroWrapper::LeftSholderPitch

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

Overview

LeftSholderPitch class for RAPIRO

Constant Summary collapse

NO =
6
DEFAULT =
50
MIN =
50
MAX =
140

Instance Method Summary collapse

Methods inherited from ServoMotor

code, find_servos, #to_code

Constructor Details

#initialize(up: nil) ⇒ LeftSholderPitch

Returns a new instance of LeftSholderPitch.



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

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