Skip to content

changed the "S" param to "Scaling" (compatability) #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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