-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 - Gap in raw data #26
Comments
Thanks for the issue, it's on my list and I'll get to this issue if not today, then tomorrow! |
Thank you for looking into that.
// This function modifies the sample averaging of the MAX30101.
// Default: 2 sample averaging.
// Register: 0x08, bits [7:5]
// SMP_AVE[2:0] - NO. OF SAMPLES AVERAGED PER FIFO SAMPLE
// 000 - 1 (no averaging)
// 001 - 2
// 010 - 4
// 011 - 8
// 100 - 16
// 101 - 32
uint8_t Max32664Hub::set_sample_averaging(uint8_t sample_averaging)
{
uint8_t bits;
uint8_t reg_val;
// Make sure the correct pulse width is selected.
if (sample_averaging <= 5)
{
bits = sample_averaging << 5;
}
else
{
return INCORR_PARAM;
}
// Get current register value so that nothing is overwritten.
reg_val = read_register_max30101(MAX30101_FIFO_CONFIG_REGISTER);
reg_val &= SAMP_AVG_MASK; // Mask bits to change.
reg_val |= bits; // Add bits
write_register_max30101(MAX30101_FIFO_CONFIG_REGISTER, reg_val); // Write Register
return SUCCESS;
}
// This function reads the register (0x08), bits [7:5] from the
// MAX30101 Sensor. It returns the sample averaging setting.
uint8_t Max32664Hub::read_sample_averaging()
{
uint8_t reg_val;
reg_val = read_register_max30101(MAX30101_FIFO_CONFIG_REGISTER);
reg_val &= READ_SAMP_AVG_MASK;
return reg_val >> 5;
} Anyway, maybe some stuff is wrong (or everything), but I thought that it was worth mentioning those results if it helps. I will use the "counter" from the payload to sync the data. |
Thanks for the follow up, this may help quite a bit. This library has a few open issues that I'd like to tackle simultaneously as they have a common thread with the ESP32 platform. Unfortunately I got bludgeoned with illness last week and I'll need to do some catch up on my current projects before I get to this. I expect I'll have some time midweek. Talk to you soon. |
Thanks for following up :-) I hope you are feeling fine again, take care and good luck with all the catching-up! Let me know if I can help in any ways! |
I suspect it has something to do with the "CMD_DELAY" being significantly reduced in later firmware releases but I still need to test with a board that has the latest firmware which I do not have. This is still ongoing, thank you for your patience. |
Hi,
Thanks for this library. I bought the oximeter sensor from Sparkfun (https://www.sparkfun.com/products/15219). I am trying to read the IR led count data but there are some periodic gaps in the data. Here is a short excerpt of the Serial monitor: https://pastebin.com/85jETjyG
Here is a graph showing periodic plateaus in the data (which are typically just gaps in data as the ESP32 is just polling the same value until a new value is available).
I have the same behaviour when reading the data only on interrupt and when the data ready flag is set to 1 (I am using ESP-IDF for that test):
The code I used when using the Arduino library is the following:
Any idea why I get those periodic gap in the raw data?
Thanks in advance!
The text was updated successfully, but these errors were encountered: