diff --git a/epicardium/modules/max86150.c b/epicardium/modules/max86150.c index 154705bfa685a4c8d8a9a31ba709cd1f98e50224..f452f303c30d8df31bdb7021b91792e843c85a72 100644 --- a/epicardium/modules/max86150.c +++ b/epicardium/modules/max86150.c @@ -66,6 +66,8 @@ int epic_max86150_enable_sensor( ppg_sample_rate = MAX86150_PPG_SAMPLERATE_100; } else if (config->ppg_sample_rate == 200) { ppg_sample_rate = MAX86150_PPG_SAMPLERATE_200; + } else if (config->ppg_sample_rate == 400) { + ppg_sample_rate = MAX86150_PPG_SAMPLERATE_400; } else { result = -EINVAL; goto out_free; diff --git a/preload/apps/spo2/__init__.py b/preload/apps/spo2/__init__.py index dbe9b83c4255e625ee290a4914fb0cb4de6f3188..12066622874e7e65ca78d94feb0716347ade28c7 100644 --- a/preload/apps/spo2/__init__.py +++ b/preload/apps/spo2/__init__.py @@ -7,7 +7,7 @@ import buttons class SPO2: def __init__(self): self.sensor = None - self.RATE = 128 + self.RATE = 100 self.HISTORY_MAX = self.RATE * 4 self.history = [] self.update_screen = 0 @@ -35,7 +35,7 @@ class SPO2: if self.update_screen >= self.DRAW_AFTER_SAMPLES: self.draw_histogram() - self.sensor = max86150.MAX86150(callback) + self.sensor = max86150.MAX86150(callback=callback, sample_rate=self.RATE * 4) while True: utime.sleep(.1) if buttons.read(buttons.BOTTOM_RIGHT):