contains my game for the embedded systems project 2645

Dependencies:   mbed FXOS8700CQQQ

main.cpp

Committer:
OmarAlebiary
Date:
2019-04-28
Revision:
31:4d4a9d78cae5
Parent:
30:c5060010a1e6
Child:
32:e5d997d2ed79

File content as of revision 31:4d4a9d78cae5:

/*
Electronic & Computer Engineering
ELEC2645 Embedded Systems Project
University of Leeds
Name:     Omar Alebiary
Username: el17oa
ID :      201172644
Date:     15/3/2019
*/
#include "RocketRacer.h"
#include "Menus.h"
#include "tests.h"

// objects 
FXOS8700CQ devicee(I2C_SDA,I2C_SCL);
//instantiating the Gamepad object 
Gamepad pad;

// instantiating the RocketRacer object 
RocketRacer Rocket_Racer;

//instantiating the lcd object and assigning the pins on the gamepad to it
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); 

//instantiating the Menus object
Menus menus;

// instantiating the tests object 
tests test;


// 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();
    devicee.init();
    
    }
    

    
    
int main(){
    
    
    setup();
//      test.test_welcomeMenu(pad,lcd);
//      test.test_Play_Welcome_Melody(pad);
//      test.test_End_Game_Melody(Gamepad &pad);
//      test.test_drawMenu(lcd, pad);
//      test.test_credits_page(lcd,pad);
//      test.test_loading_menu(lcd);
//      test.test_InstructionsMenu(pad,lcd);
//      test.test_Game_Loop(pad,lcd);
   
    menus.welcomeMenu(pad,lcd);
    menus.loading_menu(lcd);
    pad.leds_off();
    
    while(1){
    menus.drawMenu(lcd,pad);
    }
    
}