contains my game for the embedded systems project 2645

Dependencies:   mbed FXOS8700CQQQ

main.cpp

Committer:
OmarAlebiary
Date:
2019-04-18
Revision:
22:3e6ff378d651
Child:
23:2ca9735b16ef

File content as of revision 22:3e6ff378d651:

#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);
    }


}