ELEC2645 (2016/17) / Mbed 2 deprecated 2645_Project_el15as

Dependencies:   mbed

main.cpp

Committer:
el15as
Date:
2017-04-30
Revision:
5:158e2951654b
Parent:
3:e05d4de7690b
Child:
6:33fd1797beb4

File content as of revision 5:158e2951654b:

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Player.h"
#include "GameEngine.h"

N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Serial pc(USBTX, USBRX); // tx, rx
Gamepad pad;
GameEngine game;
Player player;

void update_screen();

int main()
{
    lcd.init();
    pad.init();

    lcd.normalMode();
    lcd.setBrightness(1);
    game.init(1);
    lcd.refresh();

    while(1) {  // loop forever

        game.read_input(pad,pc);
        game.update(pad, pc, lcd);
        game.draw(lcd);

        wait(1.0f/10); // 10 fps
    }
}