Reading MAX30101 Raw Data in Hexiwear


#1

Good day,
I am looking at the libraries for the MAX30101 . I just would like to sample the raw ADC value for the Red Green and IR LEDs and simply just print it to the Console window at the specified sample rate. Based on this requirement I am thinking I need to do the following:

  • Import the relevant library using the command: from maxim.max30101 import max30101

  • Create an Instance of the Max30101 class using the command: m301 = max30101.MAX30101(I2C0)

  • Turn the the device on using the command: m301.start()

  • Set the operating mode of the device to Multi Mode, with sample rate of 100 samples per second, pulse width of 400 micro seconds, the LED currents of 0.4mA for the 3 LEDs, the proximity threshold anything (does not matter since multi mode does not utilize this?) and finally activating the red, green and IR LEDs using the command: m301. init( ‘multi’, 3, 100, 400, [2,2,2,0], proximity_thrs = 0, slot_multi = [1,2,3,0]). Where does this data now go? How do I access it

  • Read the sample data outputted. Where does it go? How do I access it? data= read_raw_samples(9)? If so does this mean the ADC values are bytes(1:3) for red, bytes(4-6) for green and bytes(7-9) for IR? This 9 byte sample is the latest sample of taken by the MAX30101 from the FIFO right? What must I do print to the console 5 seconds of samples? This command must be re-called at the sample rate for the 5 seconds? Is there another way to do this?

I am now trying to familiarize myself with the resources and would greatly appreciate some patience and assistance.
Regards,
Aaron.