Skip to content

Commit 5fa5782

Browse files
Rob2lbuque
authored andcommitted
address transposition in pps.py
Functions read_mcu_temperature and read_input_voltage were using transposed addresses
1 parent 58c723e commit 5fa5782

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

m5stack/libs/module/pps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def read_input_voltage(self) -> float:
169169
Returns:
170170
float: The current input voltage in Volts.
171171
"""
172-
voltage = self.i2c.readfrom_mem(self.addr, 0x10, 4)
172+
voltage = self.i2c.readfrom_mem(self.addr, 0x14, 4)
173173
return struct.unpack("<f", voltage)[0]
174174

175175
def read_data_update_flag(self) -> int:
@@ -193,7 +193,7 @@ def read_mcu_temperature(self) -> float:
193193
Returns:
194194
float: The current MCU temperature in degrees Celsius.
195195
"""
196-
temperature = self.i2c.readfrom_mem(self.addr, 0x14, 4)
196+
temperature = self.i2c.readfrom_mem(self.addr, 0x10, 4)
197197
return struct.unpack("<f", temperature)[0]
198198

199199
def read_module_id(self) -> int:

0 commit comments

Comments
 (0)