Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp@7:b54323241435, 2017-05-02 (annotated)
- Committer:
- el15as
- Date:
- Tue May 02 00:20:44 2017 +0000
- Revision:
- 7:b54323241435
- Parent:
- 6:33fd1797beb4
- Child:
- 8:c3cf8d1057bb
Sounds added; Menu class added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el15as | 0:9aa78a94ec93 | 1 | #include "mbed.h" |
el15as | 0:9aa78a94ec93 | 2 | #include "N5110.h" |
el15as | 0:9aa78a94ec93 | 3 | #include "Gamepad.h" |
el15as | 1:5e5791293388 | 4 | #include "Player.h" |
el15as | 2:8c5c47b2372d | 5 | #include "GameEngine.h" |
el15as | 7:b54323241435 | 6 | #include "Menu.h" |
el15as | 0:9aa78a94ec93 | 7 | |
el15as | 0:9aa78a94ec93 | 8 | N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); |
el15as | 1:5e5791293388 | 9 | Serial pc(USBTX, USBRX); // tx, rx |
el15as | 0:9aa78a94ec93 | 10 | Gamepad pad; |
el15as | 2:8c5c47b2372d | 11 | GameEngine game; |
el15as | 1:5e5791293388 | 12 | Player player; |
el15as | 7:b54323241435 | 13 | Menu menu; |
el15as | 0:9aa78a94ec93 | 14 | |
el15as | 1:5e5791293388 | 15 | void update_screen(); |
el15as | 0:9aa78a94ec93 | 16 | |
el15as | 0:9aa78a94ec93 | 17 | int main() |
el15as | 0:9aa78a94ec93 | 18 | { |
el15as | 0:9aa78a94ec93 | 19 | lcd.init(); |
el15as | 1:5e5791293388 | 20 | pad.init(); |
el15as | 2:8c5c47b2372d | 21 | |
el15as | 1:5e5791293388 | 22 | lcd.normalMode(); |
el15as | 1:5e5791293388 | 23 | lcd.setBrightness(1); |
el15as | 7:b54323241435 | 24 | game.init(4); |
el15as | 0:9aa78a94ec93 | 25 | lcd.refresh(); |
el15as | 0:9aa78a94ec93 | 26 | |
el15as | 0:9aa78a94ec93 | 27 | while(1) { // loop forever |
el15as | 3:e05d4de7690b | 28 | |
el15as | 5:158e2951654b | 29 | game.read_input(pad,pc); |
el15as | 3:e05d4de7690b | 30 | game.update(pad, pc, lcd); |
el15as | 3:e05d4de7690b | 31 | game.draw(lcd); |
el15as | 2:8c5c47b2372d | 32 | |
el15as | 2:8c5c47b2372d | 33 | wait(1.0f/10); // 10 fps |
el15as | 0:9aa78a94ec93 | 34 | } |
el15as | 3:e05d4de7690b | 35 | } |