C++ class for controlling DC motor with encoder feedback. Dependencies include LS7366LIB, MotCon, and PID.
Dependencies: PID LS7366LIB MotCon2
Diff: Axis.h
- Revision:
- 9:7bc59203ce98
- Parent:
- 8:7e399d7c990d
- Child:
- 10:32faca5a2577
diff -r 7e399d7c990d -r 7bc59203ce98 Axis.h --- a/Axis.h Mon Jul 11 18:26:26 2016 +0000 +++ b/Axis.h Mon Aug 29 19:42:07 2016 +0000 @@ -10,7 +10,7 @@ class Axis{ public: - Axis(SPI& _spi, PinName _cs, PinName _pwm, PinName _dir, PinName _analog, int* limit); + Axis(SPI& _spi, PinName _cs, PinName _pwm, PinName _dir, PinName _analog, int* limit, int *busy); void paramUpdate(void); void center(void); void init(void); @@ -42,6 +42,7 @@ int moveState; int debug; int *ptr_limit; + int *ptr_busy; float motCurrent; //motor current read from readCurrent() function float mot_I_lim; //max current limit int axisState; @@ -50,6 +51,7 @@ float pos_rad, vel_rad; //current position measurement in radians float pos_deg, vel_deg; //current position measurement in degrees float ctsPerDeg; + int busyflag; Ticker update; Ticker moveProfile;