diff --git a/DHT.cpp b/DHT.cpp index a48ac74..bb770bd 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -72,6 +72,24 @@ void DHT::begin(uint8_t usec) { pullTime = usec; } +/*! + * @brief Sets the _pin property value + * @param newPin + * pin number that sensor is connected + */ +void DHT::setPin(uint8_t newPin){ + _pin = newPin; +} + +/*! + * @brief Sets the _type property value + * @param newType + * type of sensor + */ +void DHT::setType(uint8_t newType){ + _type = newType; +} + /*! * @brief Read temperature * @param S diff --git a/DHT.h b/DHT.h index 95570e1..09fc1d3 100644 --- a/DHT.h +++ b/DHT.h @@ -64,6 +64,8 @@ class DHT { public: DHT(uint8_t pin, uint8_t type, uint8_t count = 6); void begin(uint8_t usec = 55); + void setPin(uint8_t newPin); + void setType(uint8_t newType); float readTemperature(bool S = false, bool force = false); float convertCtoF(float); float convertFtoC(float);