bsiever / microbit-dstemp

Micro:bit DS18B20 Temp Sensor Blocks
https://bsiever.github.io/microbit-dstemp/
MIT License
5 stars 9 forks source link

Update dstemp.cpp #3

Closed dongjoon9331 closed 3 years ago

dongjoon9331 commented 3 years ago

I want testing something

bsiever commented 3 years ago

Pull requests are NOT for testing code. Test it using your repo and when you have a working solution I may be open to including the update in the main code via a pull request.

I may be willing to ignore the values of the alarm registers, but I will NOT ignore the CRC. If the CRC is incorrect, then it's likely that some bit (digit) of the data was incorrect. Ignoring the CRC would undermine the scientific data collection applications this extension was created to support.

The values are binary, but the effect can be explained using decimal examples. For example, consider the temperature is actually 28.01C. Randomly changing a digit could radically change the value read. It could read as 98.01C or 08.01C or 29.01C or 228.01C or 28.02C .... You have no way of knowing which digits (if any) are wrong. The CRC is there to avoid this sort of error.