Class: OneWire::Thermometer
Constant Summary collapse
- PREFIX =
%w{10 22 28 3B}
Instance Attribute Summary collapse
-
#last_value ⇒ Object
readonly
Returns the value of attribute last_value.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#dump, #id, #initialize, #name, #w1_slave
Constructor Details
This class inherits a constructor from OneWire::Base
Instance Attribute Details
#last_value ⇒ Object (readonly)
Returns the value of attribute last_value.
6 7 8 |
# File 'lib/one_wire/thermometer.rb', line 6 def last_value @last_value end |
Instance Method Details
#value ⇒ Object
8 9 10 11 |
# File 'lib/one_wire/thermometer.rb', line 8 def value @last_value = @value @value = w1_slave[/t=(\d*)/, 1].to_f / 1000 end |