#include Preferences preferences; void setup() { Serial.begin(115200); preferences.begin("my-app", false); // Initialize preferences // Store data preferences.putInt("boot_count", 42); // Read data int bootCount = preferences.getInt("boot_count", 0); Serial.println(bootCount); preferences.end(); } void loop() { // Your loop code }