ms-iot / samples

Windows 10 IoT Core Samples
MIT License
1.2k stars 1.33k forks source link

Update MainPage.xaml.h #505

Open voiptecben opened 7 years ago

voiptecben commented 7 years ago

Have rewritten the 2 routines that return the decimal temp and humidity values from the received bitstring.

These were double Humidity ( ) const and double Temperature ( ) const in mainpagexaml.h

The math was all wrong and the program returned crazy values for both temp and humidity

Have added comments explaining the new code lines that are self explanatory.
tested and it works for DHT11- Difference for DHT22 should be that is more accurate and has decimal values

jordanrh1 commented 6 years ago

I verified the sample on both the DHT11 and DHT22 and the calculations were correct. I accepted a previous pull request that claimed to correct the math, but it was wrong and I had to revert the change. I'm sorry but I cannot accept this pull request without seeing the issue and fix firsthand.