I'm trying to use the Maxim Max 30101 sensor integrated in Hexiwear in order to extract raw data from it and then to apply a better heart rate algorithm than the one available.
However, when i try to change the sample_rate and pulse_width using the set_mode function available, even if i use the standard parameters available in the docs, i'm getting always this error:
" TypeError at line 63 of __main__
raised at line 507 of maxim.max30101.max30101.set_mode
raised at line 550 of maxim.max30101.max30101._set_led
raised at line 104 of i2c.write_bytes "
My code is:
max = max30101.MAX30101(I2C0)
max.set_mode(mode = 'spo2', adc_range = 3, sample_rate = 50, pulse_width = 411,
led_current = [256,256,0,0], proximity_thrs = 0, slot_multi = [0,0,0,0])
Even if i change the parameters and the mode to "hr" or multy. i always get the same error. I've tried also to change the parameters in the max.init() function although i don't get the error the sample_rate still not changing.
I couldn't get access to the code of the max30101.set_mode function in order to check which problem is ocurring.
I would like to know how to use or which is the problem with my code to change it
Thanks in Advance for your help