Still won't work

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers globals.h Source File

globals.h

00001 // ============================================
00002 // The header file for general project settings
00003 // Spring 2018 Gatech ECE2035
00004 //=============================================
00005 #ifndef GLOBAL_H
00006 #define GLOBAL_H
00007 
00008 // Include all the hardware libraries
00009 #include "mbed.h"
00010 #include "wave_player.h"
00011 #include "MMA8452.h"
00012 #include "uLCD_4DGL.h"
00013 #include "SDFileSystem.h"
00014 
00015 // Declare the hardware interface objects
00016 extern uLCD_4DGL uLCD;      // LCD Screen
00017 extern SDFileSystem sd;     // SD Card
00018 extern Serial pc;           // USB Console output
00019 extern MMA8452 acc;       // Accelerometer
00020 extern DigitalIn button1;   // Pushbuttons
00021 extern DigitalIn button2;
00022 extern DigitalIn button3;
00023 extern AnalogOut DACout;    // Speaker
00024 extern PwmOut speaker;
00025 extern wave_player waver;
00026 
00027 // === [define the macro of error heandle function] ===
00028 // when the condition (c) is not true, assert the program and show error code
00029 #define ASSERT_P(c,e) do { \
00030     if(!(c)){ \
00031         pc.printf("\nERROR:%d\n",e); \
00032         while(1); \
00033     } \
00034 } while (0)
00035 
00036 // === [error code] ===
00037 #define ERROR_NONE 0 // All good in the hood
00038 #define ERROR_MEH -1 // This is how errors are done
00039 
00040 #endif //GLOBAL_H