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
10 changes: 5 additions & 5 deletions DHT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ void DHT::begin(uint8_t usec) {

/*!
* @brief Read temperature
* @param S
* @param Scaling
* Scale. Boolean value:
* - true = Fahrenheit
* - false = Celcius
* @param force
* true if in force mode
* @return Temperature value in selected scale
*/
float DHT::readTemperature(bool S, bool force) {
float DHT::readTemperature(bool Scaling, bool force) {
float f = NAN;

if (read(force)) {
Expand All @@ -93,7 +93,7 @@ float DHT::readTemperature(bool S, bool force) {
f = -1 - f;
}
f += (data[3] & 0x0f) * 0.1;
if (S) {
if (Scaling) {
f = convertCtoF(f);
}
break;
Expand All @@ -103,7 +103,7 @@ float DHT::readTemperature(bool S, bool force) {
if (data[2] & 0x80) {
f *= -1;
}
if (S) {
if (Scaling) {
f = convertCtoF(f);
}
break;
Expand All @@ -114,7 +114,7 @@ float DHT::readTemperature(bool S, bool force) {
if (data[2] & 0x80) {
f *= -1;
}
if (S) {
if (Scaling) {
f = convertCtoF(f);
}
break;
Expand Down
2 changes: 1 addition & 1 deletion DHT.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DHT {
public:
DHT(uint8_t pin, uint8_t type, uint8_t count = 6);
void begin(uint8_t usec = 55);
float readTemperature(bool S = false, bool force = false);
float readTemperature(bool Scaling = false, bool force = false);
float convertCtoF(float);
float convertFtoC(float);
float computeHeatIndex(bool isFahrenheit = true);
Expand Down