Skip to content

Commit c37b7cd

Browse files
committed
Changes some config values to obtain better values during rapid development
1 parent 4cce865 commit c37b7cd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

example/main.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from machine import sleep, SoftI2C, Pin
33
from utime import ticks_diff, ticks_us
44

5-
from max30102 import MAX30102
5+
from max30102 import MAX30102, MAX30105_PULSE_AMP_MEDIUM
66

77

88
def main():
@@ -45,10 +45,12 @@ def main():
4545
sensor.setup_sensor()
4646

4747
# It is also possible to tune the configuration parameters one by one.
48-
# Set the sample rate to 800: 800 samples/s are collected by the sensor
49-
sensor.set_sample_rate(800)
48+
# Set the sample rate to 400: 400 samples/s are collected by the sensor
49+
sensor.set_sample_rate(400)
5050
# Set the number of samples to be averaged per each reading
5151
sensor.set_fifo_average(8)
52+
# Set LED brightness to a medium value
53+
sensor.set_active_leds_amplitude(MAX30105_PULSE_AMP_MEDIUM)
5254

5355
sleep(1)
5456

max30102/max30102.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def __init__(self,
186186

187187
# Sensor setup method
188188
def setup_sensor(self, led_mode=2, adc_range=16384, sample_rate=400,
189-
led_power=MAX30105_PULSE_AMP_HIGH, sample_avg=8,
189+
led_power=MAX30105_PULSE_AMP_MEDIUM, sample_avg=8,
190190
pulse_width=411):
191191
# Reset the sensor's registers from previous configurations
192192
self.soft_reset()

0 commit comments

Comments
 (0)