From 6f7f80fb5f882881150324a441d7155f7f3db313 Mon Sep 17 00:00:00 2001 From: peteGSX Date: Fri, 23 Feb 2024 05:30:19 +1000 Subject: [PATCH] Working --- TurntableFunctions.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/TurntableFunctions.cpp b/TurntableFunctions.cpp index 45cdd0e..488be6d 100644 --- a/TurntableFunctions.cpp +++ b/TurntableFunctions.cpp @@ -55,11 +55,29 @@ bool lastHomeSensorState; // Stores the last home sens bool lastLimitSensorState; // Stores the last limit sensor state. unsigned long lastLimitDebounce = 0; // Stores the last time the limit sensor switched for debouncing. unsigned long lastHomeDebounce = 0; // Stores the last time the home sensor switched for debouncing. +#ifdef INVERT_DIRECTION +bool invertDirection = true; +#else +bool invertDirection = false; +#endif +#ifdef INVERT_STEPS +bool invertSteps = true; +#else +bool invertSteps = false; +#endif +#ifdef INVERT_ENABLE +bool invertEnable = true; +#else +bool invertEnable = false; +#endif AccelStepper stepper = STEPPER_DRIVER; // Function configure sensor pins void startupConfiguration() { +// #if defined(INVERT_DIRECTION) + stepper.setPinsInverted(invertDirection, invertSteps, invertEnable); +// #endif #if HOME_SENSOR_ACTIVE_STATE == LOW pinMode(homeSensorPin, INPUT_PULLUP); #elif HOME_SENSOR_ACTIVE_STATE == HIGH