Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Problem in the bmp180.lua #7

Open
jimbolimbo3 opened this issue Nov 27, 2015 · 1 comment
Open

Problem in the bmp180.lua #7

jimbolimbo3 opened this issue Nov 27, 2015 · 1 comment

Comments

@jimbolimbo3
Copy link

The terminal says:

bmp180.lua:95: divide by zero

The line 95 is this:
local X1 = (UT - AC6) * AC5 / 32768

Do you have any idea why?

@vxf
Copy link

vxf commented Dec 4, 2015

I can see a possible division by zero on the line below that:
https://github.com/javieryanez/nodemcu-modules/blob/master/bmp180/bmp180.lua#L96

Which as you can see on Bosch provided driver, based on the same algorithms, does a check before to avoid the division by zero:
https://github.com/BoschSensortec/BMP180_driver/blob/master/bmp180.c#L227-L229

So there's indeed a possible division by zero but is not checked by this lua module.

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

No branches or pull requests

2 participants