Skip to content

Commit

Permalink
Fix micropython axp2101 getTemperature
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Aug 18, 2023
1 parent aa67428 commit 3cc9b1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Micropython/src/AXP2101.py
Original file line number Diff line number Diff line change
Expand Up @@ -1780,9 +1780,9 @@ def enableTemperatureMeasure(self) -> None:
def disableTemperatureMeasure(self) -> None:
super().clrRegisterBit(_AXP2101_ADC_CHANNEL_CTRL, 4)

def getTemperature(self) -> int:
#!FIXME
return super().readRegisterH6L8(_AXP2101_ADC_DATA_RELUST8, _AXP2101_ADC_DATA_RELUST9)
def getTemperature(self) -> float:
raw = super().readRegisterH6L8(_AXP2101_ADC_DATA_RELUST8, _AXP2101_ADC_DATA_RELUST9)
return (22.0 + (7274 - raw) / 20.0)

def enableSystemVoltageMeasure(self) -> None:
super().setRegisterBit(_AXP2101_ADC_CHANNEL_CTRL, 3)
Expand Down

0 comments on commit 3cc9b1a

Please sign in to comment.