From 97d11f3fd5fc2b3aa1157a9afb8b9f2920a89682 Mon Sep 17 00:00:00 2001 From: edwin Date: Tue, 6 Dec 2022 15:21:41 +0800 Subject: [PATCH] define an empty constructor and overload DHT::begin --- DHT.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DHT.cpp b/DHT.cpp index f8fa3d4..730d6ee 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -41,8 +41,8 @@ DHT::DHT() { // 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). #ifdef __AVR - _bit = digitalPinToBitMask(pin); - _port = digitalPinToPort(pin); + _bit = digitalPinToBitMask(_pin); + _port = digitalPinToPort(_pin); #endif _maxcycles = microsecondsToClockCycles(1000); // 1 millisecond timeout for // reading pulses from DHT sensor.