Class: RPi::Dht::Dht11
Constant Summary
Constants inherited from Base
Base::BITS_IN_BYTE, Base::CLEAR_SIGNALS, Base::ENOUGH_TO_CAPTURE_COUNT, Base::HUMIDITY_PRECISION, Base::START_SIGNAL, Base::TEMPERATURE_PRECISION, Base::VALID_BYTE_SIZE
Instance Method Summary collapse
Methods inherited from Base
#collect_response_bits, #initialize, read, read!, #send_start_signal
Constructor Details
This class inherits a constructor from RPi::Dht::Base
Instance Method Details
#convert ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rpi/dht/dht11.rb', line 4 def convert humidity_high, _, temp_high, _, _ = bytes humidity = humidity_high temperature = temp_high { humidity: humidity, temperature: temperature, temperature_f: fahrenheit(temperature) } end |