-
-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Labels
Milestone
Description
To support low power usage e.g. when batteries power the sensor, one need to be able to switch of the power supply of the DHT sensor.
This would imply an additional power pin in the constructor.
This power pin has a default of 0xFF that states ==>no power pin.
DHT(datapin, powerPin = 0xFF);
void DHT.enable()
{
if (_powerPin == 0xFF) return;
digitalWrite(_powerPin , HIGH):
}
void DHT.disable()
{
if (_powerPin == 0xFF) return;
digitalWrite(_powerPin , LOW):
}
bool DHT.sensorEnabled()
{
return (_powerPin != 0xFF);
}
uint8_t _powerPin ;investigate
depending on the processor it can or cannot deliver the power from an IO pin directly.
Working with an extra mosfet is always possible
investigate
After startup a delay is needed. Put this in the library or is the user responsible?