This commit is contained in:
2026-01-12 00:53:54 +01:00
commit 2f827c168d
26 changed files with 3145 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
#pragma once
#include <Arduino.h>
#include <Preferences.h>
#include <WebServer.h>
struct AppSettings
{
// Camera
int contrast = 0; // -2 to 2
int brightness = 0; // -2 to 2
bool vFlip = false;
bool hMirror = false;
// Printer
int heatTime = 120; // 0-255 (Higher = darker but slower)
int heatInterval = 50; // 0-255
// Upload
String uploadUrl = ""; // e.g., "http://192.168.1.10:3000/upload"
bool enableUpload = false;
};
class SettingsService
{
private:
Preferences prefs;
WebServer server;
AppSettings currentSettings;
bool wifiConnected = false;
void setupRoutes();
void loadSettings();
public:
SettingsService();
void begin();
void handle();
AppSettings &get() { return currentSettings; }
void save();
};