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
wag.h@68:9245d6ce176e, 2018-04-19 (annotated)
- Committer:
- spm71
- Date:
- Thu Apr 19 15:49:06 2018 +0000
- Revision:
- 68:9245d6ce176e
- Parent:
- 66:70efa618c378
- Child:
- 72:aec869655869
Gnoll timer update
Who changed what in which revision?
User | Revision | Line number | New 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 |
spm71 | 68:9245d6ce176e | 38 | #define VOLLEY_DELAY 5000 |
spm71 | 58:69f9a4607a16 | 39 | #define LASER_DELAY 0.125 |
spm71 | 58:69f9a4607a16 | 40 | |
phn10 | 65:b8f3339b9268 | 41 | |
phn10 | 65:b8f3339b9268 | 42 | |
phn10 | 64:72f7f5757f0d | 43 | //timer expired |
phn10 | 64:72f7f5757f0d | 44 | #define WHACK_EXPIRED_TIMER 5 |
phn10 | 64:72f7f5757f0d | 45 | |
spm71 | 66:70efa618c378 | 46 | void gnoll(int sensor_no, float * sensor_values); |
phn10 | 64:72f7f5757f0d | 47 | void whack(int sensor_no, float * sensor_values); |
spm71 | 62:b73067127fd6 | 48 | void update_score(int hit, int miss); |
spm71 | 58:69f9a4607a16 | 49 | |
spm71 | 57:aef01bd9b3be | 50 | #endif |