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.
Dependencies: mbed
Fork of Lab_6_WaG by
Diff: stepper.cpp
- Revision:
- 35:ad2b3d6f0e5a
- Parent:
- 22:09dd6977576b
- Child:
- 41:9b293b14b845
--- a/stepper.cpp Thu Mar 22 16:11:56 2018 +0000 +++ b/stepper.cpp Thu Mar 22 16:41:11 2018 +0000 @@ -19,6 +19,8 @@ extern DigitalIn jog_ccw; extern DigitalIn jog_cw; +extern DigitalIn my_button; +extern DigitalIn cal_button; extern Serial pc; int stp_cur_pos; @@ -82,5 +84,33 @@ spi_send(drv8806, turn[i]); } } +} + +/* + * void step_test(); + * Description: tests the stepper motor + * + * Inputs: + * Parameters: + * Globals: + * + * Outputs: + * Returns: void +*/ +void step_test() { + while(1) { + if (jog_ccw == 0) { + stp_step(STP_CCW); + } + if (jog_cw == 0) { + stp_step(STP_CW); + } + if (cal_button == 0) { + stp_find_home(); + } + } +} + +void stp_find_home() { } \ No newline at end of file