I am working with a Adafruit M0 Express, and have hooked it up to the Adafruit 16 bit I2C ADC ADS1115. I would like to read data at 250 Hz (permitted by the I2C ADS module) and save this data onto the flash on the M0 express.
My trouble is if I just have a while True loop where I read data and write data in sequence, I am only able to record data a couple times a second (far short of 250 Hz). I suspect that this is due to the time it takes to write data, but don't know an awful lot about time limitations.
I can come up with partial workaround where I add the data to an list I keep in memory, and then save the list, but this leads to large gaps in the data during the time it takes to save the list.
So my question is:
- Is there a faster/more efficient way to save data quickly?
- Is there a way I can be adding data to my array and saving it to flash at the same time?
I am working with a Adafruit M0 Express, and have hooked it up to the Adafruit 16 bit I2C ADC ADS1115. I would like to read data at 250 Hz (permitted by the I2C ADS module) and save this data onto the flash on the M0 express.
My trouble is if I just have a while True loop where I read data and write data in sequence, I am only able to record data a couple times a second (far short of 250 Hz). I suspect that this is due to the time it takes to write data, but don't know an awful lot about time limitations.
I can come up with partial workaround where I add the data to an list I keep in memory, and then save the list, but this leads to large gaps in the data during the time it takes to save the list.
So my question is: