Hello all,
I'm working on a data logger and would like to write to the SD card. I'm using the LPC4088 Quickstart board with the base board which has the SD card reader built in. I'm using the MCIFilesystem library provided by EA.
I am writing data at 10hz
I am able to do a basic open, write, and close of the card inside the main() function of my program.
What is the best way to hand the opening, writing, an closing of the file? Should i open it once, keep writing, and close at the end? Should i be doing an open, write, close at every data write (10hz)?
I have a 10hz Ticker running and i'm calling a "writeFile()" function form it that has the code to write each additional sample, but i also have the writing of the header of the file in the main() function. Is it ok to declare my fp file handle globally so it can be used globally in the program?
OR (this just occurred to me while thinking about interrupts)
Maybe i should have my 10hz Ticker ISR simple let a flag and test for the flag in my main while loop. If flag is set, then i can do all the data sampling and writing from there...
Any input or advice would be much appreciated. Thanks
Hello all,
I'm working on a data logger and would like to write to the SD card. I'm using the LPC4088 Quickstart board with the base board which has the SD card reader built in. I'm using the MCIFilesystem library provided by EA.
I am writing data at 10hz
I am able to do a basic open, write, and close of the card inside the main() function of my program.
What is the best way to hand the opening, writing, an closing of the file? Should i open it once, keep writing, and close at the end? Should i be doing an open, write, close at every data write (10hz)?
I have a 10hz Ticker running and i'm calling a "writeFile()" function form it that has the code to write each additional sample, but i also have the writing of the header of the file in the main() function. Is it ok to declare my fp file handle globally so it can be used globally in the program?
OR (this just occurred to me while thinking about interrupts)
Maybe i should have my 10hz Ticker ISR simple let a flag and test for the flag in my main while loop. If flag is set, then i can do all the data sampling and writing from there...
Any input or advice would be much appreciated. Thanks