diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-06-22 21:51:06 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-06-22 21:51:06 (GMT) |
| commit | 88418fd1b50200642f68bd04a48f2e4094b289f7 (patch) | |
| tree | b48071a50edb71f55f1870437c48962d17896495 /wasp/boards/simulator | |
| parent | 417e408dc4821012d4b34a2bee28338cfc0b4295 (diff) | |
apps: heart: Introduce simple app for the heart rate sensor
The heart rate analysis step is still a work in progress but the current
app allows us to visualize the the results of the signal conditioning.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/boards/simulator')
| -rw-r--r-- | wasp/boards/simulator/watch.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/wasp/boards/simulator/watch.py b/wasp/boards/simulator/watch.py index 48d7122..9f9920c 100644 --- a/wasp/boards/simulator/watch.py +++ b/wasp/boards/simulator/watch.py @@ -124,6 +124,41 @@ class RTC(object): def get_uptime_ms(self): return int(self.uptime * 1000) +class HRS(): + DATA = ( +9084,9084,9025,9025,9009,9009,9009,9015,9015,9024,9024,9024,9073,9073,9074,9074, +9074,9100,9100,9097,9097,9097,9045,9045,9023,9023,9023,9035,9035,9039,9039,9039, +9049,9049,9052,9052,9052,9066,9066,9070,9070,9070,9078,9078,9081,9081,9081,9092, +9092,9093,9093,9093,9094,9094,9108,9108,9108,9124,9124,9122,9122,9122,9100,9100, +9110,9110,9110,9112,9112,9118,9118,9118,9127,9127,9136,9136,9136,9147,9147,9154, +9154,9154,9156,9156,9153,9153,9153,9152,9152,9156,9156,9156,9161,9161,9161,9177, +9177,9186,9186,9196,9196,9196,9201,9201,9201,9189,9189,9176,9176,9176,9176,9176, +9175,9175,9175,9175,9175,9180,9180,9180,9189,9189,9202,9202,9202,9207,9207,9181, +9181,9181,9167,9167,9169,9169,9169,9163,9163,9164,9164,9164,9165,9165,9172,9172, +9172,9180,9180,9192,9192,9192,9178,9178,9161,9161,9161,9163,9163,9173,9173,9173, +9170,9170,9179,9179,9183,9183,9183,9196,9196,9207,9207,9207,9208,9208,9186,9186, +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 +) + def __init__(self): + self._i = 0 + + def enable(self): + pass + + def disable(self): + pass + + def read_hrs(self): + d = self.DATA[self._i] + self._i += 1 + if self._i >= len(self.DATA): + self._i = 0 + return d + backlight = Backlight() spi = SPI(0) spi.init(polarity=1, phase=1, baudrate=8000000) @@ -136,6 +171,7 @@ drawable = draw565.Draw565(display) accel = Accelerometer() battery = Battery() button = Pin('BUTTON', Pin.IN, quiet=True) +hrs = HRS() rtc = RTC() touch = CST816S(I2C(0), Pin('TP_INT', Pin.IN, quiet=True), Pin('TP_RST', Pin.OUT, quiet=True)) vibrator = Vibrator(Pin('MOTOR', Pin.OUT, value=0), active_low=True) |
