class RapiroWrapper::Waist

Waist class for RAPIRO

Constants

DEFAULT
MAX
MIN
NO

Public Class Methods

new(left: nil, right: nil) click to toggle source
# File lib/rapiro_wrapper/servo_motor/waist.rb, line 9
def initialize(left: nil, right: nil)
  fail ArgumentError if left && right
  if left
    @value = DEFAULT + left
  elsif right
    @value = DEFAULT - right
  else
    @value = DEFAULT
  end
  fail ArgumentError unless @value.between?(MIN, MAX)
end