@saeedsadati Oh my goodness, so you are still alive, I mean your toy is still alive and kicking. That is good news, because then we can do sort of global/remote pair programming/development at two different space and time points of the Galaxy. By the way, I notice that your toy's PartID is 0x11, mine 0x15. You might like to tell me how come the discrepancy.
@saeedsadati Yes, if you can (1) i2cdetect 0x53, (2) i2cget 0x11, then your max30100 is 90% chances good. In other words, we can now use the python library to read the sensor and see why you got zeros. Anyway, next step is to use the library to again read the PartID register to get 0x11 (me 0x15), and if OK, then try to read sensor output, or temperature output.
@saeedsadati Just now I ran my readPartId program and it took me only 2 minutes to debug and got what I want - 0x15. The program listing and sample output is shown below. You might also like to try your luck and see if you can get 0x11! : )
@saeedsadati Just now I ran my readPartId program and it took me only 2 minutes to debug and got what I want - 0x15. The program listing and sample output is shown below. You might also like to try your luck and see if you can get 0x11! : ) Note: I renamed the original library program from max30100lib.py to max30100lib07.py, so that I can try changes of on the renamed library without messing up the original version, which is now used as backup.
@saeedsadati No luck in first run of the oximeter program, with an error message something like "exception name 'time' not defined." Ah, afternoon tea time, so will take a long break, cheers.
@saeedsadati So I started debugging. My usual trick is the "Occam's Razor ": Make things as simple as possible, but not simpler. So I snipped the original read sensor program as much as possible and tried my luck again. This time I had some non zero readings, as show below:
You might also like to try my readSensor(*) v09 and see if you can also get non zero results.
@saeedsadati Now I have written a demo program to do the following: (1) Read PartID and temperature registers, (2) Read sensor. Please read my answer Part B Section 3 for more details.
My answer is coming to an end. Very briefly, I have completed the following: (1) troubleshooting tricks for I2C I/O Error #121, (2) reading sensor with non-zero values. Of course we are just scratching the surface of oximeter and heart rate sensor. If you don't have other problems for me, I am taking a long break, before coming back. Feel free to make comments and suggestions at the end of my answer. Hopefully me and other visitors would join in an learn together. Good luck and cheers.
Old answer cannot edit, so repeat here: My answer is coming to an end. Very briefly, I have completed the following: (1) show troubleshooting tricks for I2C I/O Error #121, (2) reading sensor with non-zero values. Of course we are just scratching the surface of oximeter and heart rate sensor.
And if you don't have other problems for me now, I am taking a long break, before coming back. Please Feel free to make comments and suggestions at the end of my answer. Hopefully me and other visitors would join in an learn together. Good luck and cheers.