Game For ECE 2035

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Committer:
lballard9
Date:
Tue Sep 28 13:52:11 2021 +0000
Revision:
4:37d3935365f8
Parent:
0:35660d7952f7
Fall 2021 notes added

Who changed what in which revision?

UserRevisionLine numberNew 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
rconnorlawson 0:35660d7952f7 8 // Include all the hardware libraries
rconnorlawson 0:35660d7952f7 9 #include "mbed.h"
rconnorlawson 0:35660d7952f7 10 #include "wave_player.h"
rconnorlawson 0:35660d7952f7 11 #include "MMA8452.h"
rconnorlawson 0:35660d7952f7 12 #include "uLCD_4DGL.h"
rconnorlawson 0:35660d7952f7 13 #include "SDFileSystem.h"
rconnorlawson 0:35660d7952f7 14
rconnorlawson 0:35660d7952f7 15 // Declare the hardware interface objects
lballard9 4:37d3935365f8 16 /*
lballard9 4:37d3935365f8 17 This file holds all the global variables that are accessable from all the
lballard9 4:37d3935365f8 18 different files in this project. You see below most of it looks like hardware.
lballard9 4:37d3935365f8 19 That's because it is hardware! The uLCD object is how you interact with the LCD
lballard9 4:37d3935365f8 20 screen. The sd variable is how you interact with the sd card and so on for all
lballard9 4:37d3935365f8 21 the other variables.
lballard9 4:37d3935365f8 22 */
rconnorlawson 0:35660d7952f7 23 extern uLCD_4DGL uLCD; // LCD Screen
rconnorlawson 0:35660d7952f7 24 extern SDFileSystem sd; // SD Card
rconnorlawson 0:35660d7952f7 25 extern Serial pc; // USB Console output
rconnorlawson 0:35660d7952f7 26 extern MMA8452 acc; // Accelerometer
rconnorlawson 0:35660d7952f7 27 extern DigitalIn button1; // Pushbuttons
rconnorlawson 0:35660d7952f7 28 extern DigitalIn button2;
rconnorlawson 0:35660d7952f7 29 extern DigitalIn button3;
rconnorlawson 0:35660d7952f7 30 extern AnalogOut DACout; // Speaker
rconnorlawson 0:35660d7952f7 31 extern PwmOut speaker;
rconnorlawson 0:35660d7952f7 32 extern wave_player waver;
rconnorlawson 0:35660d7952f7 33
rconnorlawson 0:35660d7952f7 34 // === [define the macro of error heandle function] ===
rconnorlawson 0:35660d7952f7 35 // when the condition (c) is not true, assert the program and show error code
rconnorlawson 0:35660d7952f7 36 #define ASSERT_P(c,e) do { \
rconnorlawson 0:35660d7952f7 37 if(!(c)){ \
rconnorlawson 0:35660d7952f7 38 pc.printf("\nERROR:%d\n",e); \
rconnorlawson 0:35660d7952f7 39 while(1); \
rconnorlawson 0:35660d7952f7 40 } \
rconnorlawson 0:35660d7952f7 41 } while (0)
rconnorlawson 0:35660d7952f7 42
rconnorlawson 0:35660d7952f7 43 // === [error code] ===
rconnorlawson 0:35660d7952f7 44 #define ERROR_NONE 0 // All good in the hood
rconnorlawson 0:35660d7952f7 45 #define ERROR_MEH -1 // This is how errors are done
rconnorlawson 0:35660d7952f7 46
rconnorlawson 0:35660d7952f7 47 #endif //GLOBAL_H