explorer game

Dependencies:   mbed

main.cpp

Committer:
el17my
Date:
2020-04-28
Revision:
25:e551c09fa28b
Parent:
21:349c70c8a7de

File content as of revision 25:e551c09fa28b:

/* 
ELEC2645 Embedded Systems Project
School of Electronic & Electrical Engineering
University of Leeds
2019/20

Name:Yao mochu
Username:el17my
Student ID Number:201199854
Date:2020/4/28
*/

// includes
#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
#include "Menu.h"


// objects
Gamepad gamepad;
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Menu _menu;

int main()
{ gamepad.init();
  _menu.init(); 
  lcd.init(); 
  lcd.normalMode();      
  lcd.setBrightness(0.5);
  while(1) {
    lcd.setContrast(gamepad.read_pot());  // Contrast is controlled by pot.
    lcd.clear();  
    _menu.run_engine(lcd, gamepad);
    lcd.refresh();
    wait(0.01); }    
}