Commit d7b8753d authored by schneider's avatar schneider
Browse files

fix(max86150): Use 4x averaging on chip

parent 7a2a5d3c
......@@ -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;
......
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment