Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small issue with temperature reading, for low temperatures ( < 0C ) #1

Open
anfractuosity opened this issue Dec 28, 2020 · 0 comments

Comments

@anfractuosity
Copy link

anfractuosity commented Dec 28, 2020

First of all thanks for your code, I've been using it for a bit now, I modified it slightly
so I could just generate a .csv file from my temp sensor.

I found a small bug recently, which as far as I can tell, occurs when temperature goes below 0C.

I managed to fix it I think, using something like below:

ret["temperature"] = returnnumberpacket(pkt[report_pkt_offset + 23:report_pkt_offset + 25])
if ret["temperature"] > 32767:
    ret["temperature"] -= (2**16)
ret["temperature"] = float(ret["temperature"]) / 10

As I noticed the temperature readings become something like:
6553.4 from the original code.

There could be a nicer way to fix this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant