Skip to content
Snippets Groups Projects
Commit d7b8753d authored by schneider's avatar schneider
Browse files

fix(max86150): Use 4x averaging on chip

parent 7a2a5d3c
No related branches found
No related tags found
1 merge request!414SpO2 sensor improvements
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment