ESP32 and EEPROM()

There is a library of EEPROM in arduino esp32, and the usage seems very easy and similar to arduino one.
and the size of eeprom can be defined at begin:
EEPROM.begin(EEPROM_SIZE)



and can be written with following, i is address, the 2nd one is the contain, which has a type of Byte
EEPROM.write(i,0x00)
EEPROM.commit();
for reading:
EEPROM.read(i)

pretty easy....But you need to have  EEPROM.commit(); at the end otherwise nothing is saving into flash
now need to carefully calculate the data I need to write in.

  1. device Nr = byte
  2. softAP SSID and PSWD, let say 10 char each
Need to figure out how to arrange char string and byte array...
I need to get string of SSID and PSWD to byte[] array.
and will need to get byte[] array back to string



留言

這個網誌中的熱門文章

Meshtastic 03 adding GPS on TTGO lora32 V2

GeoSetter how to add geotag on to pictures, and export to google earth as kmz

AIS0. understanding AIS NMEA 0183: How it's coded