Method: IoT::MAX44009#initialize

Defined in:
lib/iot/max44009.rb

#initialize(i2c_bus = '/dev/i2c-1') ⇒ MAX44009

I2C sensor address



39
40
41
42
43
44
45
46
# File 'lib/iot/max44009.rb', line 39

def initialize(i2c_bus='/dev/i2c-1')
  @sensor_name = 'MAX44009'
  @i2c_bus = i2c_bus
  @device = I2CDevice.new(address: DEVICE, driver: I2CDevice::Driver::I2CDev.new(@i2c_bus))
  write_config()
  @length = 2
  @value = read_sensor
end