Modified phase table in stepper.cpp to enable stepping a bipolar motor using a twin H-bridge driver.
Fork of stepper by
Corrected single-stepping, now walking up or down just one phase table. Compile-time options for driving bipolar motor in any of single-phase, two-phase, or half-stepping. Coils remain engaged at end of specifed movement command - de-energize coils by issuing a motor.move(0) while already stopped.
Diff: stepper.h
- Revision:
- 8:75fcbd49d49f
- Parent:
- 4:5b596b405573
--- a/stepper.h Tue Dec 23 10:36:58 2014 +0000 +++ b/stepper.h Wed Dec 31 17:36:36 2014 +0000 @@ -85,7 +85,15 @@ * @param none * @return running(= 1), stopped(= 0) */ + //surely other states can be returned too eg UP, CONTINUE, CHANGE, DOWN? uint8_t status (void); + + /** De-energize coils + * @param none + * @return none + */ + void stop(); + protected: // Rotation Direction @@ -112,8 +120,7 @@ DigitalOut _xp, _xn, _yp, _yn; Ticker _smdrv; - void init(); - void set4ports (uint32_t step, int8_t dir); + void set4ports (void); void setup_mtr_drv_dt(Motor_Inf *mi, Motor_Control *mt); void millisec_inteval();