Class: RapiroWrapper::LeftFootPitch

Inherits:
ServoMotor show all
Defined in:
lib/rapiro_wrapper/servo_motor/left_foot_pitch.rb

Overview

LeftFootPitch class for RAPIRO

Constant Summary collapse

NO =
11
DEFAULT =
90
MIN =
70
MAX =
110

Instance Method Summary collapse

Methods inherited from ServoMotor

code, find_servos, #to_code

Constructor Details

#initialize(close: nil, open: nil) ⇒ LeftFootPitch

Returns a new instance of LeftFootPitch.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rapiro_wrapper/servo_motor/left_foot_pitch.rb', line 9

def initialize(close: nil, open: nil)
  fail ArgumentError if open && close
  if close
    @value = MAX - close
  elsif open
    @value = MIN + open
  else
    @value = DEFAULT
  end
  fail ArgumentError unless @value.between?(MIN, MAX)
end