Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jposada202020 committed Jun 26, 2023
1 parent a3af469 commit 15497c2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions micropython_mpl3115a2/mpl3115a2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
from micropython import const
from micropython_mpl3115a2.i2c_helpers import CBits, RegisterStruct

try:
from typing import Tuple
except ImportError:
pass


__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/jposada202020/MicroPython_MPL3115A2.git"
Expand Down Expand Up @@ -141,7 +136,7 @@ def oversample_ratio(self, value: int) -> None:
self._oversample_ratio = value

@property
def pressure(self):
def pressure(self) -> float:
"""
Read the barometric pressure detected by the sensor in Hectopascals.
"""
Expand All @@ -161,15 +156,15 @@ def pressure(self):

return pressure / 400.0

def _poll_reg1(self):
def _poll_reg1(self) -> None:
"""
Poll the ost_status to NOT be present.
"""
while self._ost_status > 0:
time.sleep(0.01)

@property
def altitude(self):
def altitude(self) -> float:
"""Read the altitude as calculated based on the sensor pressure and
previously configured pressure at sea-level. This will return a
value in meters. Set the sea-level pressure by updating the
Expand All @@ -189,7 +184,7 @@ def altitude(self):
return altitude / 65535.0

@property
def temperature(self):
def temperature(self) -> float:
"""
Read the temperature as measured by the sensor in Celsius.
"""
Expand Down

0 comments on commit 15497c2

Please sign in to comment.