GroupA / Mbed 2 deprecated WaG_final

Dependencies:   mbed

Fork of Lab_6_WaG by GroupA

Committer:
phn10
Date:
Mon Apr 23 21:21:29 2018 +0000
Revision:
72:aec869655869
Parent:
68:9245d6ce176e
Child:
74:8881f4aeb174
fixed the LED not light up in the gnoll() function. 2 issues still need to be improved:; 1. add a wait() after spi_send which light up the LED, or else the led won't light up.; 2. there is still some lagging between when laser light up and LED light up

Who changed what in which revision?

UserRevisionLine numberNew contents of line
spm71 51:1eb60f0d2f03 1 /******************************************************************************
spm71 51:1eb60f0d2f03 2 * EECS 397
spm71 51:1eb60f0d2f03 3 *
spm71 51:1eb60f0d2f03 4 * Assignment Name: Lab 6: WaG
spm71 51:1eb60f0d2f03 5 *
spm71 51:1eb60f0d2f03 6 * Authors: Sam Morrison and Phong Nguyen
spm71 51:1eb60f0d2f03 7 * File name: utility.h
spm71 51:1eb60f0d2f03 8 * Purpose: Header for WaG functions
spm71 51:1eb60f0d2f03 9 *
spm71 51:1eb60f0d2f03 10 * Created: 04/03/2018
spm71 51:1eb60f0d2f03 11 * Last Modified: 04/03/2018
spm71 51:1eb60f0d2f03 12 *
spm71 51:1eb60f0d2f03 13 ******************************************************************************/
spm71 57:aef01bd9b3be 14 #ifndef WAG_H
spm71 57:aef01bd9b3be 15 #define WAG_H
spm71 57:aef01bd9b3be 16
spm71 57:aef01bd9b3be 17 #include "mbed.h"
spm71 57:aef01bd9b3be 18 #include "io_pins.h"
spm71 57:aef01bd9b3be 19 #include "analog.h"
spm71 57:aef01bd9b3be 20 #include "display.h"
spm71 57:aef01bd9b3be 21 #include "laser.h"
spm71 57:aef01bd9b3be 22 #include "stepper.h"
spm71 57:aef01bd9b3be 23 #include "utility.h"
spm71 51:1eb60f0d2f03 24
phn10 44:4c2ba5bbba67 25 //Station Constants
spm71 53:389fe53b2642 26 #define STATION_A 0
spm71 53:389fe53b2642 27 #define STATION_B 1
phn10 44:4c2ba5bbba67 28
spm71 58:69f9a4607a16 29 //player constants
spm71 58:69f9a4607a16 30 #define GNOLLER 1
spm71 58:69f9a4607a16 31 #define WHACKER 0
spm71 58:69f9a4607a16 32
phn10 44:4c2ba5bbba67 33 //Calibration status constants
phn10 44:4c2ba5bbba67 34 #define CALIBRATED 1
spm71 57:aef01bd9b3be 35 #define NOT_CALIBRATED 0
spm71 57:aef01bd9b3be 36
spm71 58:69f9a4607a16 37 //delay times
phn10 72:aec869655869 38 #define VOLLEY_DELAY 500
spm71 58:69f9a4607a16 39 #define LASER_DELAY 0.125
spm71 58:69f9a4607a16 40
phn10 65:b8f3339b9268 41
phn10 64:72f7f5757f0d 42 //timer expired
phn10 64:72f7f5757f0d 43 #define WHACK_EXPIRED_TIMER 5
phn10 64:72f7f5757f0d 44
spm71 66:70efa618c378 45 void gnoll(int sensor_no, float * sensor_values);
phn10 64:72f7f5757f0d 46 void whack(int sensor_no, float * sensor_values);
spm71 62:b73067127fd6 47 void update_score(int hit, int miss);
spm71 58:69f9a4607a16 48
spm71 57:aef01bd9b3be 49 #endif