This is a very simple program, and it works fine except for one thing: The outputs from the sensor does not break the do/while loop even when they exceed the settings. The variable "minutes" will break the loop, but not "temp" or "humid".
I have tried re-ordering the parameters in the while statement, I have tried different number formats, I have not been able to find out anything about this on the forums.
The board is a Uno series R3. The sensor is an Adafruit DHT22 Wired.
I attached the sketch in a .txt file. The output from the Serial Monitor is below, and the loop should have failed at the beginning since Temperature is less than 75 F and the Humidity is greater than 20%.
Please show me what I am doing wrong, thank you.
10:17:57.681 -> minutes = 7
10:17:57.681 -> temperature = 66.74
10:17:57.717 -> humidity = 46.70
10:18:02.683 -> minutes = 6
10:18:02.683 -> temperature = 66.56
10:18:02.717 -> humidity = 44.70
10:18:07.694 -> minutes = 5
10:18:07.694 -> temperature = 66.56
10:18:07.728 -> humidity = 44.50
10:18:12.688 -> minutes = 4
10:18:12.723 -> temperature = 66.56
10:18:12.723 -> humidity = 44.30
10:18:17.690 -> minutes = 3
10:18:17.724 -> temperature = 66.56
10:18:17.724 -> humidity = 44.20
10:18:22.722 -> minutes = 2
10:18:22.722 -> temperature = 66.56
10:18:22.758 -> humidity = 44.10
10:18:27.726 -> minutes = 1
10:18:27.726 -> temperature = 66.56
10:18:27.762 -> humidity = 44.00
10:18:32.717 -> minutes = 0
10:18:32.751 -> temperature = 66.56
10:18:32.751 -> humidity = 43.90
do_while_sketch_20210105.txt (1.22 KB)