Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SDSK.h@1:491a39c644b1, 2018-04-05 (annotated)
- Committer:
- williamweatherholtz
- Date:
- Thu Apr 05 19:12:24 2018 +0000
- Revision:
- 1:491a39c644b1
- Parent:
- 0:913deac5f975
- Child:
- 2:ea603e66a32e
a Clearpath SDSK trapezoidal control implementation
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| williamweatherholtz | 0:913deac5f975 | 1 | #ifndef SDSK_h | 
| williamweatherholtz | 0:913deac5f975 | 2 | #define SDSK_h | 
| williamweatherholtz | 0:913deac5f975 | 3 | |
| williamweatherholtz | 0:913deac5f975 | 4 | #include <mbed.h> | 
| williamweatherholtz | 0:913deac5f975 | 5 | |
| williamweatherholtz | 0:913deac5f975 | 6 | class SDSK | 
| williamweatherholtz | 0:913deac5f975 | 7 | { | 
| williamweatherholtz | 0:913deac5f975 | 8 | public: | 
| williamweatherholtz | 1:491a39c644b1 | 9 | SDSK(PinName _pin_step, PinName _pin_dir, uint32_t _steps_per_rev=51200, double _max_acc=360, double _max_vel=180, uint32_t _min_us_step_pulse=4, bool _positive_is_ccw=true); | 
| williamweatherholtz | 0:913deac5f975 | 10 | |
| williamweatherholtz | 0:913deac5f975 | 11 | void move(double target_angle); | 
| williamweatherholtz | 0:913deac5f975 | 12 | |
| williamweatherholtz | 0:913deac5f975 | 13 | void reverse(); | 
| williamweatherholtz | 0:913deac5f975 | 14 | void zero(); | 
| williamweatherholtz | 0:913deac5f975 | 15 | void set_max_acc(double _max_acc); | 
| williamweatherholtz | 0:913deac5f975 | 16 | void set_max_vel(double _max_vel); | 
| williamweatherholtz | 0:913deac5f975 | 17 | |
| williamweatherholtz | 1:491a39c644b1 | 18 | void take_step(); | 
| williamweatherholtz | 0:913deac5f975 | 19 | |
| williamweatherholtz | 0:913deac5f975 | 20 | private: | 
| williamweatherholtz | 0:913deac5f975 | 21 | DigitalOut step; | 
| williamweatherholtz | 0:913deac5f975 | 22 | DigitalOut dir; | 
| williamweatherholtz | 0:913deac5f975 | 23 | bool positive_is_ccw; // changes to -1 if untrue | 
| williamweatherholtz | 0:913deac5f975 | 24 | |
| williamweatherholtz | 0:913deac5f975 | 25 | double max_acc; | 
| williamweatherholtz | 0:913deac5f975 | 26 | double max_vel; | 
| williamweatherholtz | 0:913deac5f975 | 27 | |
| williamweatherholtz | 0:913deac5f975 | 28 | uint32_t min_us_step_pulse; | 
| williamweatherholtz | 0:913deac5f975 | 29 | double position_angle; | 
| williamweatherholtz | 0:913deac5f975 | 30 | |
| williamweatherholtz | 0:913deac5f975 | 31 | uint32_t steps_per_rev; | 
| williamweatherholtz | 0:913deac5f975 | 32 | double steps_per_angle; | 
| williamweatherholtz | 0:913deac5f975 | 33 | |
| williamweatherholtz | 1:491a39c644b1 | 34 | Serial pc; | 
| williamweatherholtz | 1:491a39c644b1 | 35 | |
| williamweatherholtz | 1:491a39c644b1 | 36 | Timer profile_time; | 
| williamweatherholtz | 1:491a39c644b1 | 37 | |
| williamweatherholtz | 0:913deac5f975 | 38 | }; | 
| williamweatherholtz | 0:913deac5f975 | 39 | #endif |