Class DhtBase
Temperature and Humidity Sensor DHTxx
[Interface("Temperature and Humidity Sensor DHTxx")]
public abstract class DhtBase
- Inheritance
-
DhtBase
- Derived
Constructors
DhtBase(I2cDevice)
Create a DHT sensor through I2C (Only DHT12)
public DhtBase(I2cDevice i2cDevice)
Parameters
i2cDevice
I2cDeviceThe I2C device used for communication.
DhtBase(int, int, PinNumberingScheme, GpioController?, bool)
Create a DHT sensor
public DhtBase(int pinEcho, int pinTrigger, PinNumberingScheme pinNumberingScheme = PinNumberingScheme.Logical, GpioController? gpioController = null, bool shouldDispose = true)
Parameters
pinEcho
intThe pin number which is used as echo (GPIO number)
pinTrigger
intThe pin number which is used as trigger (GPIO number)
pinNumberingScheme
PinNumberingSchemeThe GPIO pin numbering scheme
gpioController
GpioControllerGpioController related with operations on pins
shouldDispose
booltrue to dispose the GpioController
Fields
_controller
GpioController related with the _pin.
protected GpioController? _controller
Field Value
_i2cDevice
I2C device used to communicate with the device
protected I2cDevice? _i2cDevice
Field Value
_pin
GPIO pin
protected readonly int _pin
Field Value
_readBuff
Read buffer
protected byte[] _readBuff
Field Value
- byte[]
_rxChannel
The receiver channel used to receive the signals.
protected ReceiverChannel? _rxChannel
Field Value
_shouldDispose
True to dispose the Gpio Controller
protected readonly bool _shouldDispose
Field Value
Properties
Humidity
Get the last read of relative humidity in percentage
[Telemetry]
public virtual RelativeHumidity Humidity { get; }
Property Value
Remarks
If last read was not successful, it returns
default(RelativeHumidity)
IsLastReadSuccessful
How last read went, true
for success, false
for failure
public bool IsLastReadSuccessful { get; }
Property Value
Temperature
Get the last read temperature
[Telemetry]
public virtual Temperature Temperature { get; }
Property Value
Remarks
If last read was not successful, it returns
default(Temperature)
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()