Particle Photons here. Porting all my projects over to Zerynth from particle ide, well, because of python.
Stuck on a small part of just writing a couple values to internal flash as constants options for my script to use for that particular device. (ie number of leds in a strip, different with each device but using the same code).
I just need a couple int values and a boolean or two (which i could just save as int 1 or 0)
I have been playing with the internal flash library, and all the functions operate, but i cannot get consistent results. (or im not writing to the flash correctly)
data = flash.FlashFileStream(0x80E0000,32)
i can see byte data:
i have also tried:
data.read_int() with some results
but how can i write to those bytes so i can read them back how i wrote them?
i do a:
but im not sure how it wants that buf data
data.write(‘99’) doesn’t seem to do what you would expect
its not like i can read back data and get 99
or how would i write an int to flash so that data.read_int() works?
the flash library example gets into json and writes back the length before the data, but i dont need anything fancy, just simple int value stored i can read back (even if it was a string i could just parse my values out of)
can someone toss me an example maybe of how i could just write and read simple int values saved to internal flash?