Code: Select all
#include <Preferences.h>
Serial.begin(115200);
preference.begin("my-app", false);
unsigned int counter = preference.getUInt("counter", 0);
// Increase counter by 1
counter++;
// Print the counter to Serial Monitor
Serial.printf("Current counter value: %u\n", counter);
// Store the counter to the Preferences
preference.putUInt("counter", counter);
// Close the Preferences
preference.end();
// Wait 10 seconds
Serial.println("Restarting in 10 seconds...");
delay(10000);
// Restart ESP
ESP.restart();
[env:pico32]
platform = espressif32
board = pico32
framework = arduino
monitor_speed = 115200
I've tried this other one, but it doesn't work for me either.
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
However, when I use another esp32 it works normally