zhenye yang
/
el17zy
Yang Zhenye 201199680
main.cpp@3:30c81344beff, 2020-05-08 (annotated)
- Committer:
- yangzhenye
- Date:
- Fri May 08 09:09:49 2020 +0000
- Revision:
- 3:30c81344beff
- Child:
- 4:eb8dca1dc341
improve project
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangzhenye | 3:30c81344beff | 1 | #include "mbed.h" |
yangzhenye | 3:30c81344beff | 2 | #include "Gamepad.h" |
yangzhenye | 3:30c81344beff | 3 | #include "N5110.h" |
yangzhenye | 3:30c81344beff | 4 | #include "Menu.h" |
yangzhenye | 3:30c81344beff | 5 | |
yangzhenye | 3:30c81344beff | 6 | |
yangzhenye | 3:30c81344beff | 7 | // objects |
yangzhenye | 3:30c81344beff | 8 | Gamepad gamepad; |
yangzhenye | 3:30c81344beff | 9 | N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); |
yangzhenye | 3:30c81344beff | 10 | Menu _menu; |
yangzhenye | 3:30c81344beff | 11 | |
yangzhenye | 3:30c81344beff | 12 | int main() |
yangzhenye | 3:30c81344beff | 13 | { gamepad.init(); |
yangzhenye | 3:30c81344beff | 14 | _menu.init(); |
yangzhenye | 3:30c81344beff | 15 | lcd.init(); |
yangzhenye | 3:30c81344beff | 16 | lcd.normalMode(); |
yangzhenye | 3:30c81344beff | 17 | lcd.setBrightness(0.5); |
yangzhenye | 3:30c81344beff | 18 | while(1) { |
yangzhenye | 3:30c81344beff | 19 | lcd.clear(); |
yangzhenye | 3:30c81344beff | 20 | _menu.run(lcd, gamepad); |
yangzhenye | 3:30c81344beff | 21 | lcd.refresh(); |
yangzhenye | 3:30c81344beff | 22 | wait(0.01); } |
yangzhenye | 3:30c81344beff | 23 | } |