I just started working on a data recorder widget/app for the Bangle and want to limit the file size to keep a maximum of one week worth of data. Which amounts to around 1000 lines in a text file (1 line/10 min).
Now that the storage size is limited and flash mem has a limited number of write cycles I was wondering what would be the best way to handle this.
In a simple solution I would
open the data file
read all lines into an array
append the new line to the array
write all lines, but the first, into the file
Since I'm quite new to developing for the Espruino I don't want to mess up the flash within a few days of the widget repeatedly writing to the flash.
Do you have any suggestions how the proposed solution could be improved?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hello everyone,
I just started working on a data recorder widget/app for the Bangle and want to limit the file size to keep a maximum of one week worth of data. Which amounts to around 1000 lines in a text file (1 line/10 min).
Now that the storage size is limited and flash mem has a limited number of write cycles I was wondering what would be the best way to handle this.
In a simple solution I would
Since I'm quite new to developing for the Espruino I don't want to mess up the flash within a few days of the widget repeatedly writing to the flash.
Do you have any suggestions how the proposed solution could be improved?