#include <Preferences.h>
#include <nvs.h>

Preferences prefs;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Hello, ESP32!");
  prefs.begin("test_ns");
  prefs.putUInt("test1", 42);
  prefs.putString("test2","Test String");
  nvs_iterator_t it = nvs_entry_find("nvs", "test_ns", NVS_TYPE_ANY);
  while (it != NULL) {
          nvs_entry_info_t info;
          nvs_entry_info(it, &info);
          it = nvs_entry_next(it);
          printf("key '%s', type '%d' \n", info.key, info.type);
  };
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(10); // this speeds up the simulation
}