Hi,
I am having troubles saving my collected data fast enough on a micro sd (via OpenLog Qwiic) so I thought I could take an artemis, which has more RAM and buffer up an array, until the RAM is full. Unfortunately, I cannot find a function that measures RAM for the Artemis. With a normal RedBoard or an Arduino UNO that works easily with the freeMemory() function. That function does not work for artemis.
Any ideas?
Cheers
I’m fairly sure we could add that function. Is it part of the standard Arduino API or a library?
I’ll log this as an issue on the Arduino core
https://github.com/sparkfun/Arduino_Apollo3/issues/205
Thank you!
https://playground.arduino.cc/Code/AvailableMemory/
It is a library. This link forwards you to the github page. Do you know what my best option is to buffer data on the RAM of the artemis. I am trying to save as much data at the RAM, to have high sampling rate, and writing it to the SD card later on. On integer variable can just save 255 values, whereas the RAM should have way more space to save data. Any ideas?
Since you’re (presumably) writing ASCII characters to the SD card, use sprintf() to write your data to a buffer made of a char array, which you periodically write to the SD card when some condition is met (time, enough data, etc). There are some examples of this somewhere but I couldn’t find them in my quick look.
My application code makes a line of data with a 500(?) character buffer declared globally as “char myBuffer[500];”. The Apollo3 has a huge amount of RAM (384kB), and each char uses 1byte. So even a 1000 character buffer will only use 1kB of the RAM.