summaryrefslogtreecommitdiff
path: root/wasp/steplogger.py
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2021-02-25 08:00:03 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2021-02-25 08:00:03 (GMT)
commit7a5990072c230e35eb990377ddce608706cb0a0e (patch)
treed5fc0d7ee87bb013da7d95701f00d545c1c86a09 /wasp/steplogger.py
parent72f5322cc31e5ec70e85d436310b8dcd15eb4f59 (diff)
apps: steps: Add a history graph
The steplogger records steps but currently there is no way to see the data recorded on the device itself. Make a first attempt at graphing the step data. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/steplogger.py')
-rw-r--r--wasp/steplogger.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wasp/steplogger.py b/wasp/steplogger.py
index eb5946d..c008d8e 100644
--- a/wasp/steplogger.py
+++ b/wasp/steplogger.py
@@ -58,7 +58,7 @@ class StepIterator:
self._f = None
class StepLogger:
- def __init__(self):
+ def __init__(self, manager):
self._data = array.array('H', (0,) * DUMP_LENGTH)
self._steps = wasp.watch.accel.steps
@@ -69,7 +69,7 @@ class StepLogger:
# Queue a tick
self._t = int(wasp.watch.rtc.time()) // TICK_PERIOD * TICK_PERIOD
- wasp.system.set_alarm(self._t + TICK_PERIOD, self._tick)
+ manager.set_alarm(self._t + TICK_PERIOD, self._tick)
def _tick(self):
"""Capture the current step count in N minute intervals.