88 lines
1.9 KiB
C
88 lines
1.9 KiB
C
#pragma once
|
|
#include <Arduino.h>
|
|
#include <FastAccelStepper.h>
|
|
#include <WiFi.h>
|
|
#include <time.h>
|
|
|
|
const char* ssid = "DEIN_WLAN_NAME";
|
|
const char* password = "DEIN_PASSWORT";
|
|
|
|
// NTP-Server & Zeitzone für Deutschland
|
|
const char* ntpServer = "pool.ntp.org";
|
|
const char* tzInfo = "CET-1CEST,M3.5.0,M10.5.0/3";
|
|
|
|
FastAccelStepperEngine engine = FastAccelStepperEngine();
|
|
FastAccelStepper *stepper = NULL;
|
|
|
|
// Pins
|
|
#define dirPinStepper D1
|
|
#define enablePinStepper D2
|
|
#define stepPinStepper D3
|
|
|
|
#define buttonPlus D7
|
|
#define buttonMinus D8
|
|
#define buttonStop D9
|
|
|
|
#define senTemp D0
|
|
#define I2C_SDA D4
|
|
#define I2C_SCL D5
|
|
|
|
// ################ Variabeln ################
|
|
const uint32_t MAX_SPEED_HZ = 106000;
|
|
const int32_t COLDTEMP_C = 50;
|
|
|
|
bool clickPlus = 0;
|
|
bool clickMinus = 0;
|
|
bool clickStop = 0;
|
|
bool holdPlus = 0;
|
|
bool holdMinus = 0;
|
|
bool holdStop = 0;
|
|
|
|
int32_t lastControl = 0;
|
|
uint32_t lastPlotTime = 0;
|
|
|
|
uint32_t lastDispTime = 0;
|
|
bool autoStop = false;
|
|
bool bSettings = false;
|
|
uint32_t curTemp = 0;
|
|
|
|
struct tm timeinfo;
|
|
|
|
struct settings{
|
|
int settingIdx = 0;
|
|
int startHour = 0;
|
|
int startMin = 0;
|
|
int endHour = 0;
|
|
int endMin = 0;
|
|
bool timerEnabled = false;
|
|
bool editMaxTemp = false;
|
|
int16_t maxTemp = 70; //in °C
|
|
bool editAcc = false;
|
|
int32_t accelRate = 2000;
|
|
}
|
|
|
|
enum TimeEditStep {
|
|
EDIT_NONE = 0, // Normales Menü (Navigation)
|
|
EDIT_START_HOUR, // 1. Start-Stunde einstellen (0-23)
|
|
EDIT_START_MIN, // 2. Start-Minute einstellen (0-59)
|
|
EDIT_END_HOUR, // 3. End-Stunde einstellen (0-23)
|
|
EDIT_END_MIN // 4. End-Minute einstellen (0-59)
|
|
};
|
|
|
|
TimeEditStep timeEditStep = EDIT_NONE;
|
|
|
|
// fest in den Speicher schreiben
|
|
Preferences prefs;
|
|
|
|
// Dein Einstellungs-Struct
|
|
struct SystemSettings {
|
|
uint8_t startHour = 0;
|
|
uint8_t startMin = 0;
|
|
uint8_t endHour = 0;
|
|
uint8_t endMin = 0;
|
|
bool timerEnabled = false;
|
|
int16_t maxTemp = 70;
|
|
int32_t accelRate = 2000;
|
|
};
|
|
|
|
SystemSettings settings;
|