Skip to content

Commit 8a29c3c

Browse files
committed
lsm6dsox: Use steps() getter instead of property.
Signed-off-by: Sebastian Romero <s.romero@arduino.cc>
1 parent d3948df commit 8a29c3c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

micropython/drivers/imu/lsm6dsox/lsm6dsox.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,7 @@ def pedometer_int2_enabled(self, enable):
383383
self._clear_bits(_EMB_FUNC_INT2, _PEDO_INT_MASK)
384384
self.set_mem_bank(_FUNC_CFG_BANK_USER)
385385

386-
@property
387-
def pedometer_steps(self):
386+
def steps(self):
388387
"""Return the number of detected steps."""
389388
self.set_mem_bank(_FUNC_CFG_BANK_EMBED)
390389
self._read_reg_into(_STEP_COUNTER_L, self.scratch_2b)

micropython/drivers/imu/lsm6dsox/lsm6dsox_pedometer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def on_step_detected(pin):
4343
last_steps = 0 # Keep track of the last step count to detect changes.
4444

4545
while True:
46-
steps = lsm.pedometer_steps
46+
steps = lsm.steps()
4747

4848
if steps != last_steps:
4949
print(f"Steps: {steps}")

0 commit comments

Comments
 (0)