Skip to content

Commit

Permalink
Working
Browse files Browse the repository at this point in the history
  • Loading branch information
peteGSX committed Feb 22, 2024
1 parent 93ddbd2 commit 6f7f80f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions TurntableFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f7f80f

Please sign in to comment.