Skip to content

Commit

Permalink
changed the S param name
Browse files Browse the repository at this point in the history
  • Loading branch information
MalinkyZubr committed Nov 19, 2023
1 parent 2295fe4 commit 20d8ab9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit 20d8ab9

Please sign in to comment.