![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Finished V1
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
globals.h@4:2297a714936f, 2019-11-19 (annotated)
- Committer:
- trich9
- Date:
- Tue Nov 19 16:53:47 2019 +0000
- Revision:
- 4:2297a714936f
- Parent:
- 0:35660d7952f7
- Child:
- 5:2fb023cdc666
11/19/2019;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rconnorlawson | 0:35660d7952f7 | 1 | // ============================================ |
rconnorlawson | 0:35660d7952f7 | 2 | // The header file for general project settings |
rconnorlawson | 0:35660d7952f7 | 3 | // Spring 2018 Gatech ECE2035 |
rconnorlawson | 0:35660d7952f7 | 4 | //============================================= |
rconnorlawson | 0:35660d7952f7 | 5 | #ifndef GLOBAL_H |
rconnorlawson | 0:35660d7952f7 | 6 | #define GLOBAL_H |
rconnorlawson | 0:35660d7952f7 | 7 | |
trich9 | 4:2297a714936f | 8 | //MYCODE |
trich9 | 4:2297a714936f | 9 | #define NUMBUCKETS 75 |
trich9 | 4:2297a714936f | 10 | #define MAPWIDTH 75 |
trich9 | 4:2297a714936f | 11 | #define MAPHEIGHT 75 |
trich9 | 4:2297a714936f | 12 | |
trich9 | 4:2297a714936f | 13 | #define MAP2WIDTH 20 |
trich9 | 4:2297a714936f | 14 | #define MAP2HEIGHT 10 |
trich9 | 4:2297a714936f | 15 | |
rconnorlawson | 0:35660d7952f7 | 16 | // Include all the hardware libraries |
rconnorlawson | 0:35660d7952f7 | 17 | #include "mbed.h" |
rconnorlawson | 0:35660d7952f7 | 18 | #include "wave_player.h" |
rconnorlawson | 0:35660d7952f7 | 19 | #include "MMA8452.h" |
rconnorlawson | 0:35660d7952f7 | 20 | #include "uLCD_4DGL.h" |
rconnorlawson | 0:35660d7952f7 | 21 | #include "SDFileSystem.h" |
rconnorlawson | 0:35660d7952f7 | 22 | |
rconnorlawson | 0:35660d7952f7 | 23 | // Declare the hardware interface objects |
rconnorlawson | 0:35660d7952f7 | 24 | extern uLCD_4DGL uLCD; // LCD Screen |
rconnorlawson | 0:35660d7952f7 | 25 | extern SDFileSystem sd; // SD Card |
rconnorlawson | 0:35660d7952f7 | 26 | extern Serial pc; // USB Console output |
rconnorlawson | 0:35660d7952f7 | 27 | extern MMA8452 acc; // Accelerometer |
rconnorlawson | 0:35660d7952f7 | 28 | extern DigitalIn button1; // Pushbuttons |
rconnorlawson | 0:35660d7952f7 | 29 | extern DigitalIn button2; |
rconnorlawson | 0:35660d7952f7 | 30 | extern DigitalIn button3; |
rconnorlawson | 0:35660d7952f7 | 31 | extern AnalogOut DACout; // Speaker |
rconnorlawson | 0:35660d7952f7 | 32 | extern PwmOut speaker; |
rconnorlawson | 0:35660d7952f7 | 33 | extern wave_player waver; |
rconnorlawson | 0:35660d7952f7 | 34 | |
rconnorlawson | 0:35660d7952f7 | 35 | // === [define the macro of error heandle function] === |
rconnorlawson | 0:35660d7952f7 | 36 | // when the condition (c) is not true, assert the program and show error code |
rconnorlawson | 0:35660d7952f7 | 37 | #define ASSERT_P(c,e) do { \ |
rconnorlawson | 0:35660d7952f7 | 38 | if(!(c)){ \ |
rconnorlawson | 0:35660d7952f7 | 39 | pc.printf("\nERROR:%d\n",e); \ |
rconnorlawson | 0:35660d7952f7 | 40 | while(1); \ |
rconnorlawson | 0:35660d7952f7 | 41 | } \ |
rconnorlawson | 0:35660d7952f7 | 42 | } while (0) |
rconnorlawson | 0:35660d7952f7 | 43 | |
rconnorlawson | 0:35660d7952f7 | 44 | // === [error code] === |
rconnorlawson | 0:35660d7952f7 | 45 | #define ERROR_NONE 0 // All good in the hood |
rconnorlawson | 0:35660d7952f7 | 46 | #define ERROR_MEH -1 // This is how errors are done |
rconnorlawson | 0:35660d7952f7 | 47 | |
rconnorlawson | 0:35660d7952f7 | 48 | #endif //GLOBAL_H |