There were often errors associated with prematurely cutting off the pulse train. Rather than depend on the exact number of incoming pulses, which varies depending on the timing of the start up, what for a timeout interval than always use the last 81 pulses received. This reduces the number of errors , especially on the faster M4 boards.
Also added a test to see if this was a dht11 and increased the delay between reads to 1 second as in the data sheet. dht22 uses .5 seconds
There were often errors associated with prematurely cutting off the pulse train. Rather than depend on the exact number of incoming pulses, which varies depending on the timing of the start up, what for a timeout interval than always use the last 81 pulses received. This reduces the number of errors , especially on the faster M4 boards.
Also added a test to see if this was a dht11 and increased the delay between reads to 1 second as in the data sheet. dht22 uses .5 seconds