Storing variable without resetting Bluetooth connection? #2340
Replies: 5 comments
-
Posted at 2017-09-26 by @allObjects Espruino has an option to write into the unused / free flash eeprom area (located in the address space after the firmware). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-09-26 by Wilberforce Take a look here: http://www.espruino.com/Reference#l_Flash_read You can convert your data to a json string to store or use these classes: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-09-27 by MobiTech Thanks, could you tell me how to securely use Flash module? I would not like to override Espruino or something else. Do you have a short example how to write and read an integer value from Flash storage? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-09-27 by @allObjects In the console, enter Note though, that this may change with an any update or change of the firmware. Therefore, before you update, read the data back, store it somewhere, do an update of Espruino, then get the free pages again, adjust your writing/reading positions of the Flash EEPROM if needed, and load the data back into Espruino. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-10-02 by @gfwilliams I'd suggest you use the It provides a nice, safe interface to the flash memory which allows you to read and write data pretty easily. It also does it in a way that will be careful not to wear out flash memory if you do lots of writes. There are some good examples of usage on that page - for instance:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-09-26 by MobiTech
Hello, I would like to store a simple integer value (1-200) on the Puck.js without stopping the Bluetooth connection. If I would use save(), the connection is lost. And it is definitely too much for storing only one variable. Is there a better way to do it without interrupting the rest of the Puck.js?
Beta Was this translation helpful? Give feedback.
All reactions