Class: IoT::DigitalReceptor

Inherits:
Receptor show all
Defined in:
lib/iot/digital_receptor.rb

Overview

DigitalReceptor - receptor with digitized values

Direct Known Subclasses

BH1750, DigitalSensor

Constant Summary collapse

@@one_wire_bus =
'/sys/bus/w1/devices'

Class Method Summary collapse

Methods inherited from Receptor

#initialize, #model_name, #name, #read

Constructor Details

This class inherits a constructor from IoT::Receptor

Class Method Details

.one_wire_file(prefix = '28*', device = 'w1_slave') ⇒ Object



9
10
11
12
13
14
15
# File 'lib/iot/digital_receptor.rb', line 9

def self.one_wire_file(prefix='28*', device='w1_slave')
  files = Dir[@@one_wire_bus+'/'+prefix]
  if files.size > 0 then
    @sensor_file = files[0]+'/'+device
  end
  @sensor_file
end