Class: I2CDevice::D6T44L
- Defined in:
- lib/i2c/device/d6t-44l.rb
Defined Under Namespace
Classes: InvalidParityException
Constant Summary
Constants inherited from I2CDevice
Instance Attribute Summary
Attributes inherited from I2CDevice
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ D6T44L
constructor
A new instance of D6T44L.
- #read_data ⇒ Object
Methods inherited from I2CDevice
Constructor Details
#initialize(args = {}) ⇒ D6T44L
Returns a new instance of D6T44L.
7 8 9 10 |
# File 'lib/i2c/device/d6t-44l.rb', line 7 def initialize(args={}) args[:address] = 0x0a super end |
Instance Method Details
#read_data ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/i2c/device/d6t-44l.rb', line 12 def read_data data = i2cget(0x4c, 35) unless checkPEC(data, false) raise InvalidParityException end # PTAT はセンサ内部の参照温度データ ptat, *pixels = data[0..-2].unpack("v*") { :PTAT => ptat, :PIXELS => pixels.each_slice(4).to_a } end |