element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum I want to create c code for max30100
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 8 replies
  • Answers 2 answers
  • Subscribers 389 subscribers
  • Views 2664 views
  • Users 0 members are here
Related

I want to create c code for max30100

nittuseth
nittuseth over 5 years ago

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

  • Sign in to reply
  • Cancel

Top Replies

  • BigG
    BigG over 5 years ago +3 suggested
    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…
  • Jan Cumps
    Jan Cumps over 5 years ago in reply to nittuseth +2 suggested
    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…
  • Jan Cumps
    Jan Cumps over 5 years ago in reply to nittuseth +2
    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…
Parents
  • Jan Cumps
    0 Jan Cumps over 5 years ago

    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.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Jan Cumps
    0 Jan Cumps over 5 years ago

    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.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • nittuseth
    0 nittuseth over 5 years ago in reply to Jan Cumps

    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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 5 years ago in reply to nittuseth

    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.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • nittuseth
    0 nittuseth over 5 years ago in reply to Jan Cumps

    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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • BigG
    0 BigG over 5 years ago in reply to nittuseth

    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.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 5 years ago in reply to nittuseth

    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.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube