contains my game for the embedded systems project 2645
Dependencies: mbed FXOS8700CQQQ
Diff: main.cpp
- Revision:
- 22:3e6ff378d651
- Child:
- 23:2ca9735b16ef
diff -r 5c98996d1487 -r 3e6ff378d651 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 18 23:13:24 2019 +0000 @@ -0,0 +1,69 @@ +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "RocketRacer.h" +#include "Menus.h" +// objects + +/** + * @brief initializing the Gamepad object + */ +Gamepad pad; +/** + * @brief initializing the RocketRacer object + */ +RocketRacer Rocket_Racer; +/** + * @brief initializing the lcd object and assigning the pins on the gamepad to it + */ +N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); +/** + * @brief initializing the Menus object + */ +Menus menus; + +// prototypes +/** + * @brief object initialization method + * @param None @details method that initializes objects like lcd,gampad and sets the default + * contrast of the lcd and brightness + */ +void setup(); +/** + * @brief main method + * @param None @details main method that has all the method calls of the Menus.cpp and + * the RocketRacer class and has the Game_Loop method that runs the game + */ +int main(); + + + +void setup(){ + + lcd.init();//initialize the lcd + pad.init();//initialize the pad + lcd.clear(); + lcd.setBrightness(0.4);//sets the default brightness + lcd.setContrast(0.55);//set the default contrast + lcd.normalMode(); + + } + + + + +int main(){ + + + setup(); + menus.welcomeMenu(pad,lcd); + + menus.InstructionsMenu(pad,lcd); + //keeps looping untill the player loses + while(1){ + Rocket_Racer.Game_Loop(lcd,pad); + } + + +} +