Moved to ESP32 and added webinterface for PenConfiguration.
Not working and removed: - AccelStepper: Move to FastAccelStepper for ESP32 - Servo: Changed to ESP32 - check if that is ok - Serial Comm Interface now at 115200 -> change back to 9600 later
This commit is contained in:
@@ -2,10 +2,16 @@
|
||||
#define EGGDUINO_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#ifdef ESP32
|
||||
#include <ESP32Servo.h>
|
||||
#include <WiFi.h>
|
||||
#include <WebServer.h>
|
||||
#include <SPIFFS.h>
|
||||
#else
|
||||
#include <Servo.h>
|
||||
#include <avr/eeprom.h>
|
||||
#endif
|
||||
|
||||
#include "AccelStepper.h"
|
||||
#include <AccelStepper.h>
|
||||
#include "SerialCommand.h"
|
||||
#include "button.h"
|
||||
|
||||
@@ -26,8 +32,12 @@
|
||||
|
||||
#define servoPin 4
|
||||
|
||||
#define penUpPosEEAddress ((uint16_t *)0)
|
||||
#define penDownPosEEAddress ((uint16_t *)2)
|
||||
struct ConfigParameter {
|
||||
const char *key;
|
||||
int *value;
|
||||
String description;
|
||||
int defaultValue;
|
||||
};
|
||||
|
||||
extern AccelStepper rotMotor;
|
||||
extern AccelStepper penMotor;
|
||||
@@ -52,6 +62,9 @@ extern float rotSpeed;
|
||||
extern float penSpeed;
|
||||
extern boolean motorsEnabled;
|
||||
|
||||
extern ConfigParameter configParameters[];
|
||||
extern const size_t configParameterCount;
|
||||
|
||||
void makeComInterface();
|
||||
void initHardware();
|
||||
void moveOneStep();
|
||||
@@ -68,4 +81,12 @@ void prepareMove(uint16_t duration, int penStepsEBB, int rotStepsEBB);
|
||||
void storePenUpPosInEE();
|
||||
void storePenDownPosInEE();
|
||||
|
||||
bool initConfigStore();
|
||||
bool loadConfigFromFile();
|
||||
bool saveConfigToFile();
|
||||
String buildConfigJson();
|
||||
bool applyConfigJson(const String &payload, String &errorMessage);
|
||||
void startWebInterface();
|
||||
void handleWebInterface();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user