1
0
Fork 0

simulator: Reverse the simulated PPG waveform

This avoids an implusive change in base value and makes the waveform a
little more interesting.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2020-06-24 21:16:46 +01:00
parent adcc67cd61
commit b1faec667d

View file

@ -140,11 +140,11 @@ class HRS():
9186,9182,9182,9193,9193,9193,9197,9197,9188,9204,9204,9212,9212,9212,9223,9223,
9228,9228,9228,9235,9235,9215,9215,9215,9217,9217,9225,9225,9225,9230,9230,9237,
9237,9237,9246,9246,9260,9260,9260,9270,9270,9269,9269,9269,9256,9256,9256,9256,
9256,9263,9263,9274,9274,9274,9288,9288,9292,9292,9292,9307,9307,9310,9310,9310,
9292,9292,9291,9291,9291,9297,9297,9298,9298,9298
9256,9263,9263,9274,9274,9274,9288,9288,9292,9292,9292,9307,9307,9310
)
def __init__(self):
self._i = 0
self._step = 1
def enable(self):
pass
@ -154,9 +154,15 @@ class HRS():
def read_hrs(self):
d = self.DATA[self._i]
self._i += 1
self._i += self._step
if self._i >= len(self.DATA):
self._i = 0
self._i -= 1
self._step = -1
elif self._i < 0:
self._i += 1
self._step = 1
return d
backlight = Backlight()