/
spaceswimmer
/
perf-source
Обзор
Документация
Войти
/
spaceswimmer
/
perf-source
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
PerfSource/Config.h
69 строк
2 KB
spaceswimmer
master removed sleeping in loop
06 апр 2026, 11:56
06 апр 2026, 11:56
e32908d
Код
Авторство
О чём код?
#ifndef CONFIG_H #define CONFIG_H #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #include <DNSServer.h> #include <ESPAsyncWebServer.h> #include <Preferences.h> #include <SPI.h> #include <WiFi.h> #include <Wire.h> #define CONTROL_PIN_1 5 // Реле (актив LOW: при запуске = LOW, ожидание = HIGH) #define CONTROL_PIN_2 8 // Доп. выход (актив HIGH: при запуске = HIGH, ожидание = LOW) #define CONTROL_PIN_3 3 // Voltage output (актив HIGH: при запуске = HIGH, ожидание = LOW) #define BUTTON_PIN 0 // Кнопка (GND при нажатии, INPUT_PULLUP) #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET -1 extern Adafruit_SSD1306 display; extern Preferences preferences; extern const char* ssid; extern const char* password; extern bool wifiEnabled; extern unsigned long buttonPressStartTime; extern unsigned long LONG_PRESS_DURATION; extern AsyncWebServer server; extern DNSServer dnsServer; extern float fMin_exact; extern float fMax_exact; extern int fMin_display; extern int fMax_display; extern float tMax; extern String law; extern bool isRunning; extern unsigned long startTime; extern float currentProgress; extern uint8_t currentPotValue; const int POT_CS = 2; const int POT_SCK = 6; const int POT_SDI = 7; const int POT_SDO = -1; extern uint8_t lastWrittenPotValue; extern uint8_t startPotValue; extern bool lastButtonState; extern unsigned long lastDebounceTime; extern const unsigned long debounceDelay; extern bool buttonWasPressed; extern const unsigned char bitmap_128x64[] PROGMEM; struct SchedulePoint { unsigned long timeMs; uint8_t potValue; }; extern SchedulePoint schedule[1200]; extern int scheduleSize; void loadConfig(); void saveConfigIfNeeded(int newFMin, int newFMax, float newTMax, const String& newLaw); #endif