class RapiroWrapper::LeftFootPitch

LeftFootPitch class for RAPIRO

Constants

DEFAULT
MAX
MIN
NO

Public Class Methods

new(close: nil, open: nil) click to toggle source
# 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