Hi, i am using max30100 sensor,but i don't know how to operate ,i want to create c code for max30100,i want not use max30100 labirary.plz help me.sir
Hi, i am using max30100 sensor,but i don't know how to operate ,i want to create c code for max30100,i want not use max30100 labirary.plz help me.sir
The MAXREFDES117#: Heart-Rate and Pulse-Oximetry Monitor is based on the max30102:
https://www.maximintegrated.com/en/design/reference-design-center/system-board/6300.html/tb_tab2
If TL;DR then buried within that webpage is a link to the library code:
https://github.com/MaximIntegratedRefDesTeam/RD117_ARDUINO/
PS: Of course you can also simply open up Arduino go to Sketch -> Include Library -> Manage Libraries... and type in "MAX301" and you'll find a number of 3rd party libraries.
nittuseth wrote:
... don't know how to operate ... not use max30100 labirary.
If you don't want to use the library, you could read the source code of it and learn how it talks the IC.
Then you can create your own independent code based on those learnings.
Yeah I don't want to use the max30100 library,I am using atmega328,I use wire library for I2c,but I want to create max30100 oximeter c code.please help me
Yeah I don't want to use the max30100 library,I am using atmega328,I use wire library for I2c,but I want to create max30100 oximeter c code.please help me
Nittu, here are 2 people that have done it before:
In c++.
https://github.com/kontakt/MAX30100/tree/master/src
You could use the exact same code, but have to turn the class members into C functions.
from
void MAX30100::setLEDs(pulseWidth pw, ledCurrent red, ledCurrent ir){ uint8_t reg = I2CreadByte(MAX30100_ADDRESS, MAX30100_SPO2_CONFIG); reg = reg & 0xFC; // Set LED_PW to 00 I2CwriteByte(MAX30100_ADDRESS, MAX30100_SPO2_CONFIG, reg | pw); // Mask LED_PW I2CwriteByte(MAX30100_ADDRESS, MAX30100_LED_CONFIG, (red<<4) | ir); // write LED configs }
to:
void MAX30100_setLEDs(pulseWidth pw, ledCurrent red, ledCurrent ir){ uint8_t reg = MAX30100_I2CreadByte(MAX30100_ADDRESS, MAX30100_SPO2_CONFIG); reg = reg & 0xFC; // Set LED_PW to 00 MAX30100_I2CwriteByte(MAX30100_ADDRESS, MAX30100_SPO2_CONFIG, reg | pw); // Mask LED_PW MAX30100_I2CwriteByte(MAX30100_ADDRESS, MAX30100_LED_CONFIG, (red<<4) | ir); // write LED configs }
The 2 data members can become variables in your C file:
uint16_t IR = 0; // Last IR reflectance datapoint uint16_t RED = 0; // Last Red reflectance datapoint
If you do not like that library, then there is this python code:
https://github.com/mfitzp/max30100/blob/master/max30100.py
It can be translated 1 for 1 into C functions. Replace i2c.xxx() with the wire functions.
Sir, I don't know c++ language.i know c programmin glanguage , please help me,i.am using atmega328 Arduino,plz help me,plz send me all c code for max30100 heart beat and spo2 in.c program
Please could you give some more background to your intentions as Arduino libraries are written in c++ and there are already max30100 libraries available for ATMEGA328 on the Arduino IDE.
nittuseth wrote:
Sir, I don't know c++ language.i know c programmin glanguage , please help me,i.am using atmega328 Arduino,plz help me,plz send me all c code for max30100 heart beat and spo2 in.c program
Nittu, I don't think that anyone will do the work for you.
If you know C, you will understand the c++ example well enough - if you follow the link and check it - to write your own C code based on it.