Lab 6 code.

Dependencies:   mbed

Fork of WaG by GroupA

Committer:
spm71
Date:
Fri Apr 06 18:25:19 2018 +0000
Revision:
56:048b30c9f2a1
Parent:
53:389fe53b2642
Final update

Who changed what in which revision?

UserRevisionLine numberNew 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 50:e3a03bc1e1a6 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 36: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 18:0e281922212c 39
spm71 18:0e281922212c 40 #endif