define an empty constructor and overload DHT::begin

This commit is contained in:
edwin 2022-12-06 15:21:41 +08:00
parent e375a0b11f
commit 97d11f3fd5

View File

@ -41,8 +41,8 @@ DHT::DHT() {
// initialize members _pin and _type in the class definition. // initialize members _pin and _type in the class definition.
// They can be modified via DHT::begin(uint8_t pin, uint8_t type, uint8_t usec). // They can be modified via DHT::begin(uint8_t pin, uint8_t type, uint8_t usec).
#ifdef __AVR #ifdef __AVR
_bit = digitalPinToBitMask(pin); _bit = digitalPinToBitMask(_pin);
_port = digitalPinToPort(pin); _port = digitalPinToPort(_pin);
#endif #endif
_maxcycles = microsecondsToClockCycles(1000); // 1 millisecond timeout for _maxcycles = microsecondsToClockCycles(1000); // 1 millisecond timeout for
// reading pulses from DHT sensor. // reading pulses from DHT sensor.