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
stepper.h@78:84ce90a76594, 2018-04-27 (annotated)
- Committer:
- spm71
- Date:
- Fri Apr 27 20:14:21 2018 +0000
- Revision:
- 78:84ce90a76594
- Parent:
- 77:73e1cf3a7284
Finished
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
spm71 | 18:0e281922212c | 1 | /****************************************************************************** |
spm71 | 18:0e281922212c | 2 | * EECS 397 |
spm71 | 18:0e281922212c | 3 | * |
spm71 | 42:6cba679a4ee4 | 4 | * Assignment Name: Lab 6: WaG |
spm71 | 18:0e281922212c | 5 | * |
spm71 | 18:0e281922212c | 6 | * Authors: Sam Morrison and Phong Nguyen |
spm71 | 18:0e281922212c | 7 | * File name: stepper.h |
spm71 | 18:0e281922212c | 8 | * Purpose: Header for stepper driver |
spm71 | 18:0e281922212c | 9 | * |
spm71 | 18:0e281922212c | 10 | * Created: 03/02/2018 |
spm71 | 42:6cba679a4ee4 | 11 | * Last Modified: 03/29/2018 |
spm71 | 18:0e281922212c | 12 | * |
spm71 | 18:0e281922212c | 13 | ******************************************************************************/ |
spm71 | 18:0e281922212c | 14 | |
spm71 | 18:0e281922212c | 15 | #ifndef STEPPER_H |
spm71 | 18:0e281922212c | 16 | #define STEPPER_H |
spm71 | 18:0e281922212c | 17 | |
spm71 | 20:d23bcd97f2c5 | 18 | #define SPI_DRV8806_ID 2 |
spm71 | 18:0e281922212c | 19 | #define DRV8806_SPI_NO_BITS 8 |
spm71 | 18:0e281922212c | 20 | #define DRV8806_SPI_MODE 0 |
spm71 | 18:0e281922212c | 21 | #define DRV8806_SPI_FREQ 1000000 |
spm71 | 18:0e281922212c | 22 | #define STP_CW 0 |
spm71 | 19:ad514b1dd53f | 23 | #define STP_CCW 1 |
spm71 | 18:0e281922212c | 24 | #define STP_POS_UNKN -5 |
phn10 | 44:4c2ba5bbba67 | 25 | #define TGT_SENSOR_QUAN 8 |
spm71 | 78:84ce90a76594 | 26 | #define MOTOR_DELAY 0.003 |
spm71 | 53:389fe53b2642 | 27 | #define TURN_DELAY 0.005 |
spm71 | 18:0e281922212c | 28 | |
spm71 | 18:0e281922212c | 29 | |
spm71 | 18:0e281922212c | 30 | #include "mbed.h" |
spm71 | 18:0e281922212c | 31 | #include "io_pins.h" |
spm71 | 18:0e281922212c | 32 | |
spm71 | 18:0e281922212c | 33 | void stp_init(); |
spm71 | 18:0e281922212c | 34 | void stp_step(int direction); |
spm71 | 35:ad2b3d6f0e5a | 35 | void step_test(); |
spm71 | 39:abf211b17e3c | 36 | void stp_find_home(); |
phn10 | 44:4c2ba5bbba67 | 37 | void stp_calibrate(int station, float * sensor_values, int * cal_status); |
spm71 | 52:8987e38851e5 | 38 | void repeatability_test(int sensor_position, int cal_status); |
spm71 | 58:69f9a4607a16 | 39 | void turn_to_target(int target); |
spm71 | 18:0e281922212c | 40 | |
spm71 | 18:0e281922212c | 41 | #endif |