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

Dependencies:   mbed

main.cpp

Committer:
el15as
Date:
2017-05-01
Revision:
6:33fd1797beb4
Parent:
5:158e2951654b
Child:
7:b54323241435

File content as of revision 6:33fd1797beb4:

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