No idea what the issue is, but I saw some other people got it working on a regular ESP32, so I thought I'd share my troubleshooting trying to get this sketch to work on an ESP32-C3.
I know the MAX board works because I have tested it with the Sparkfun library and it works fine there.
But in this sketch, nothing happens whatsoever - the LEDs do not light up, and not even a single word gets printed to the Serial monitor. Even if DEBUG is defined/uncommented.
Even if I add "Serial.println("hellothere!!!");" after Serial.begin, it never prints.
...until I comment out the line "maxim_max30102_init();".
In fact I can strip down the code to almost nothing:
If that init line is commented, the serial prints "hellothere" just fine. But if I uncomment the maxim_max30102_init line, the serial never prints anything.
I have no idea how this line being present is blocking the Serial print from showing up since the Serial print line is before the init line.
I have dug into the cpp file and played around with things like I2C speeds, comparing it to the working Sparkfun "begin" function, but I could not get that init function to work. I have no idea why, or what is different about the C3 that is making it not work.
The C3 supposedly supports all the way up to 400kbps I2C. But again I tried changing it to 100000 and it still didn't work, so I don't think the I2C speed is the issue.
No idea what the issue is, but I saw some other people got it working on a regular ESP32, so I thought I'd share my troubleshooting trying to get this sketch to work on an ESP32-C3.
I know the MAX board works because I have tested it with the Sparkfun library and it works fine there.
But in this sketch, nothing happens whatsoever - the LEDs do not light up, and not even a single word gets printed to the Serial monitor. Even if DEBUG is defined/uncommented.
Even if I add "Serial.println("hellothere!!!");" after Serial.begin, it never prints.
...until I comment out the line "maxim_max30102_init();".
In fact I can strip down the code to almost nothing:
If that init line is commented, the serial prints "hellothere" just fine. But if I uncomment the maxim_max30102_init line, the serial never prints anything.
I have no idea how this line being present is blocking the Serial print from showing up since the Serial print line is before the init line.
I have dug into the cpp file and played around with things like I2C speeds, comparing it to the working Sparkfun "begin" function, but I could not get that init function to work. I have no idea why, or what is different about the C3 that is making it not work.
The C3 supposedly supports all the way up to 400kbps I2C. But again I tried changing it to 100000 and it still didn't work, so I don't think the I2C speed is the issue.