Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions DHT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions DHT.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down