class Rumba::Sensor::BumpsAndWheelDrops

Public Class Methods

convert(v) click to toggle source
# File lib/rumba/sensors.rb, line 79
def self.convert(v)
  h = {}
  h[:bump_right]       = v & 0b1 > 0
  h[:bump_left]        = v & 0b10 > 0
  h[:wheel_drop_right] = v & 0b100 > 0
  h[:wheel_drop_left]  = v & 0b1000 > 0
  h
end