You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
532 B
C++

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <LittleFS.h>
#include <PairsFile.h>
PairsFile conFile(&LittleFS, "/net.dat", 3000);
void setup() {
Serial.begin(115200);
delay(1000);
LittleFS.begin();
conFile.begin(); // прочитать из файла
Serial.print("data:");
Serial.println(conFile["key"]);
delay(3000);
conFile["key"] = "value"; // изменили
}
void loop() {
conFile.tick(); // тикаем тут. Само обновится после таймаута
}