05-01-2024, 03:30
(04-01-2024, 09:22)Palmyweather Wrote: Probably a pointless test:
To try and confirm if the error is in the "dht.reading" line, I added two lines which set the variables to zero before the reading is done. Conclusion from doing this, it successfully takes one reading before returning zero after that. Therefore I conclude that it is not getting another reading to repopulate the variable, not calling the correct routine.
Code:#if (TH_SENSOR1 == 1)
// ----- Read temperature from DHT22 (in celsius) -------
void read_DHT22()
{
T_ExtS1 = 0; // Added line for testing
H_ExtS1 = 0; // Added line for testing
dht.reading(T_ExtS1, H_ExtS1);
T_ExtS1 = T_ExtS1 * 10;
H_ExtS1 = H_ExtS1 * 10;
}
#endif
That confirms my thoughts on last post. After the first reading, further readings fail.
If you want to enable the debug info of the DTHxx library, open the DHTxx.cpp file and on this line change the value to 1
Code:
#define DEBUG_DHT 0 // add code to send info over the serial port of non-zeroSave and compile (later don't forget to disable the Debug output).
If possible please also check if there is 5V on the Dat pin (provided by the pull-up resistor on the TX pcb).

