JamesNewton / Arduino_Dynamixel_Stepper_Controller

USB adapter to Arduino with Dynamixel Shield provides simple digital IO and motion.
1 stars 0 forks source link

Add support for stepper motors #4

Open JamesNewton opened 2 years ago

JamesNewton commented 2 years ago

https://www.airspayce.com/mikem/arduino/AccelStepper/classAccelStepper.html Not sure it supports changing the pin the motor is connected to. You have to set the pins and type in the instantiation of the sepper object. AccelStepper stepper(AccelStepper::DRIVER, STEPPER_STEP_PIN, STEPPER_DIR_PIN) Pre-set the stepper motor pin? Or can we call stepper.AccelStepper(AccelStepper::DRIVER, p, n) after the fact?

Op Description
#,#M step, direction Motor stepper.AccelStepper(AccelStepper::DRIVER, p, n) (or hard code pins if necessary)
#,#V acceleration,velocity stepper.setAcceleration(p + 1);stepper.setMaxSpeed(n);
,#V velocity (p is zero) stepper.setAcceleration(DEFAULT_ACCEL);stepper.setMaxSpeed(n);
#G position Goto stepper.moveTo(n);
#E pin Endstop. Input with Pullup. Run motor ccw until pin goes low. stepper.setMaxSpeed(SLOW_SPEED); stepper.moveTo(-MAX_LONG); if (!digitalRead(n)) stepper.stop();