ELEC2645 (2018/19) / Mbed 2 deprecated el17lw

Dependencies:   mbed

main.cpp

Committer:
lewisgw
Date:
2019-05-03
Revision:
26:4253656c0755
Parent:
21:20478f086bc2
Child:
28:be77ad6c0bda

File content as of revision 26:4253656c0755:

/*
ELEC2645 Embedded Systems Project
School of Electronic & Electrical Engineering University of Leeds
Name: Lewis Wooltorton
Username: el17lw
Student ID Number: 201122085 Date: March 2019
*/

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

N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Gamepad gamepad;
Menu menu;

void init_game();

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