guild icon
Toit
#Can I get somekind of SPIFFS on my device with Toit?
Thread channel in help
Koirin
Koirin 12/14/2022 09:52 AM
Is it possible to save simple text, to my device' memory for later use with Toit?
I'd like to be able to save a simple text-message, which then should be read incase of loss of connection or crash of the device. Is this possible?
floitsch
floitsch 12/14/2022 09:53 AM
You can use the FlashStore for that.
https://libs.toit.io/device/class-FlashStore
floitsch
floitsch 12/14/2022 09:54 AM
import device show FlashStore main: store := FlashStore store.set "key" "value" print (store.get "key")
floitsch
floitsch 12/14/2022 09:55 AM
There is also a Store interface in the same library. You should use that one in all places except where you allocate the FlashStore. This way it gets easier to replace it with something else (for example for testing).
Koirin
Koirin 12/14/2022 10:05 AM
Nice, I'll try it out. Thanks!
5 messages in total