Write to file in spark core

Is there a way i can save settings into a file (Storing the file in spark) …
The idea is i want to update these settings from the cloud into a settings file (small file it wont exceed the 2kb).
Save file and read from file . ?

2- Will the file be lost if the spark core turned off ?

Thanks all for such community and such help as always

Best regards,
Maroun

You may want to check out the Persisting state thread. I believe what you’re interested in is being discussed at length in that thread. You wouldn’t store the settings in a file per se, but would be storing values in EEPROM/flash memory locations instead.

int addr = 1;
uint8_t val = 0x45;
EEPROM.write(addr, val);

the sample shows storing of 0x45.

can i store a integer ?? like

int addr = 1;
int val = 100;
EEPROM.write(addr, val);

??

EDIT :

uint8_t a = 15; /* decimal /
uint8_t b = 0x0F; /
hexidecimal */

I got it we used uint8_t a cause it is less bits than int so we could store more data . and the 0x45 = 69 .
but why in the sample we didnt put uint8_t a = 69
is hexidecimal more beneficial ?