Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
adding reset command
Browse files Browse the repository at this point in the history
  • Loading branch information
jposada202020 committed Aug 7, 2023
1 parent b1c69a0 commit 9a621f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions micropython_adt7410/adt7410.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
_TEMP_LOW = const(0x06)
_TEMP_CRITICAL = const(0x08)
_TEMP_HYSTERESIS = const(0x0A)
_RESET = const(0x2F)

CONTINUOUS = const(0b00)
ONE_SHOT = const(0b01)
Expand Down Expand Up @@ -384,3 +385,8 @@ def hysteresis_temperature(self, value: int) -> None:
if value not in range(0, 16, 1):
raise ValueError("Temperature should be between 0°C and 15°C")
self._temperature_hysteresis = value

def reset(self) -> None:
"""Reset the sensor to default values"""
self._i2c.writeto(self._address, bytes([_RESET]))
time.sleep(0.0002)

0 comments on commit 9a621f5

Please sign in to comment.