ELEC2645 (2018/19) / Mbed 2 deprecated el16y2m

Dependencies:   mbed

main.cpp

Committer:
MYY
Date:
2019-05-06
Revision:
10:3ecbf164c0d3
Parent:
9:03aa2479b941
Child:
11:ef3d6696ae84

File content as of revision 10:3ecbf164c0d3:

#include "Level.h"
#include "Initialization.h"



N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);

Menu Menu;
Level Level;
Rotate Rotate;
Release Release;
Detect detect;
Draw Draw;
logistic logistic;
TNT TNT;
Timer_cal Timer_cal;
Image Image;
Initialization Initialization;
InterruptIn A(PTB9);
InterruptIn START(PTC5);
InterruptIn B(PTD0);
InterruptIn Back(PTB19);
Gamepad Gamepad;

void init();
void init_value();

int main()
{
    Initialization.init(lcd, A, B, Back, START, Gamepad);
    Initialization.init_value(Rotate, Level);
    while(1) {
        switch(level) {
            case 1:
                Level.level_1(Menu, Image, lcd, Rotate, Release, detect, Draw, START, B, Back, A, TNT, Gamepad, logistic, Timer_cal, Level);
                break;

            case 2:
                Menu.TNT_m(lcd, A, B);
                Level.level_2(Image, lcd, Rotate, Release, detect, Draw, A, B, TNT, logistic, Timer_cal, Level);
                break;

            case 3:
                Menu.TNT_m(lcd, A, B);
                Level.level_3(Image, lcd, Rotate, Release, detect, Draw, A, B, TNT, logistic, Timer_cal, Level);
                break;
        }
    }
}