Mochu Yao explorer game
Dependencies: mbed
Diff: main.cpp
- Revision:
- 16:ccd6f707dc79
- Parent:
- 15:814084bbc111
- Child:
- 19:14c5427b30d1
diff -r 814084bbc111 -r ccd6f707dc79 main.cpp --- a/main.cpp Tue Apr 28 12:12:24 2020 +0000 +++ b/main.cpp Tue Apr 28 12:21:31 2020 +0000 @@ -0,0 +1,37 @@ +/* +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_game(lcd, gamepad); + lcd.refresh(); + wait(0.01); } +} \ No newline at end of file