shaoziyang / microbit-lib

all kinds of microbit python drives, libs, examples, etc.
MIT License
49 stars 39 forks source link

Max recursion reached #4

Closed damianburrin closed 5 years ago

damianburrin commented 5 years ago

When I call the getAltitude function I get a runtime error for maximum recursion.

Any help greatly appreciated capture

shaoziyang commented 5 years ago

It may cause by new micropython 1.0 recursion limit, I will do more test late.

You may modify bmp180.py as below momentarily.

class BMP180(): ... ...

# Calculating absolute altitude
def getAltitude(self):
    self.get()
    return 44330*(1-(self.P()/101325)**(1/5.255))
damianburrin commented 5 years ago

Thank you