Advertisement
NittyGritty

Untitled

Jun 4th, 2023
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. in Datei LittleFS.ino (am Ende eingefügt)
  2.  
  3. bool freeSpace(uint16_t const& printsize) { // Funktion um beim speichern in Logdateien zu prüfen ob noch genügend freier Platz verfügbar ist.
  4. FSInfo fs_info; LittleFS.info(fs_info); // Füllt FSInfo Struktur mit Informationen über das Dateisystem
  5. //Serial.printf("Funktion: %s meldet in Zeile: %d FreeSpace: %s\n", __PRETTY_FUNCTION__, __LINE__, formatBytes(fs_info.totalBytes - (fs_info.usedBytes * 1.05)).c_str());
  6. return (fs_info.totalBytes - (fs_info.usedBytes * 1.05) > printsize) ? true : false;
  7. }
  8.  
  9. in Wochenzeitschaltuhr8266.ino (vor setup() eingefügt)
  10. constexpr uint8_t devicePin[] = {D5, D6}; // Pin für Relais einstellen
  11. constexpr auto count = 10; // Anzahl Schaltzeiten (analog Html Dokument) einstellen 2 bis 16
  12. constexpr auto aktiv = LOW; // LOW für LOW aktive Relais oder HIGH für HIGH aktive (zB. SSR, Mosfet) einstellen
  13. bool deviceState[] {!aktiv, !aktiv};
  14.  
  15. struct Collection {
  16. byte switchActive[count];
  17. byte wday[count];
  18. char switchTime[count * 2][6];
  19. };
  20.  
  21. Collection times;
  22.  
  23. String sketchName() { // Dateiname für den Admin Tab ab EspCoreVersion 2.6.0
  24. char file[sizeof(__FILE__)] = __FILE__;
  25. char * pos = strrchr(file, '.'); *pos = '\0';
  26. return file;
  27. }
  28.  
  29. in Zeitlogger.ino in Funktion timeDataLogger geändert
  30.  
  31. void timeDataLogger(const uint8_t num, const String customer) { // Relais Nummer und Ereignisauslöser
  32. static bool lastrelState[] {!aktiv, !aktiv};
  33. static bool relState[] {!aktiv, !aktiv}; // zugefügt
  34.  
  35. in Zeitschaltuhr.ino die Pin-Werte "active" gegen "aktiv" getauscht
  36.  
  37.  
  38.  
  39.  
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement