Skip to content
Prev Previous commit
Next Next commit
Streamlines sensor driver code, comments out debug print statements
  • Loading branch information
Stanlist committed Jul 1, 2022
commit e0cacfaa331bb1b6c68f8e7e18571ed035809ccb
10 changes: 5 additions & 5 deletions libs/sensors/src/DHT22.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ bool DHT::update() {
// Only asks for data if more than 2 seconds has lapsed since last call
if (!_firsttime) {
if (int(currentTime - _lastReadTime) < 2) {
printf("Too Fast!");
// printf("Too Fast!");
return false;
}
} else {
Expand All @@ -72,7 +72,7 @@ bool DHT::update() {

do {
if (retryCount > 125) {
printf("Bus Busy");
// printf("Bus Busy");
return false;
}
retryCount++;
Expand All @@ -91,7 +91,7 @@ bool DHT::update() {
retryCount = 0;
do {
if (retryCount > 40) {
printf("No Response from sensor");
// printf("No Response from sensor");
return false;
}
retryCount++;
Expand All @@ -107,7 +107,7 @@ bool DHT::update() {
retryCount = 0;
do {
if (retryCount > 75) {
printf("Data Timeout");
// printf("Data Timeout");
return false;
}
retryCount++;
Expand Down Expand Up @@ -145,7 +145,7 @@ bool DHT::update() {
_lastHumidity = CalcHumidity();

} else {
printf("Checksum failed");
// printf("Checksum failed");
return false;
}

Expand Down
2 changes: 0 additions & 2 deletions test-apps/test-temp-RH/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
int main() {
Sensor::DHT sensor(D7);
while (true) {
// MBED_ASSERT(sensor.update());

ThisThread::sleep_for(2000ms);

if (sensor.update()) {
Expand Down