diff --git a/Gaugecontroller/gauge_config.h b/Gaugecontroller/gauge_config.h new file mode 100644 index 0000000..d2a92e2 --- /dev/null +++ b/Gaugecontroller/gauge_config.h @@ -0,0 +1,31 @@ +#pragma once +#include + +struct GaugeConfig { + // Hardware + uint8_t dirPin; + uint8_t stepPin; + int8_t enablePin; // -1 = no enable pin + bool dirInverted; + bool stepActiveHigh; + bool enableActiveLow; + + // Motion defaults (integers; cast to float in setup()) + long minPos; + long maxPos; + long homingBackoffSteps; + int maxSpeed; // steps/s + int accel; // steps/s² + int homingSpeed; // steps/s +}; + +constexpr GaugeConfig gaugeConfigs[] = { + // dir step en dirInv stepHi enLow min max backoff speed accel homeSpd + { 48, 49, -1, false, true, true, 0, 3780, 3800, 4000, 6000, 500 }, + { 8, 9, -1, true, true, true, 0, 3780, 3800, 4000, 6000, 500 }, + { 52, 53, -1, false, true, true, 0, 3780, 3800, 4000, 6000, 500 }, + { 50, 51, -1, false, true, true, 0, 3780, 3800, 4000, 6000, 500 }, +}; + +static const uint8_t GAUGE_COUNT = + sizeof(gaugeConfigs) / sizeof(gaugeConfigs[0]);