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
Animation/Animation.cpp@5:158e2951654b, 2017-04-30 (annotated)
- Committer:
- el15as
- Date:
- Sun Apr 30 22:51:35 2017 +0000
- Revision:
- 5:158e2951654b
- Parent:
- 4:1f7f32f3e017
- Child:
- 6:33fd1797beb4
Added a switch and a door.; Programmed first three levels.
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| el15as | 5:158e2951654b | 1 | #include "mbed.h" | 
| el15as | 5:158e2951654b | 2 | #include "N5110.h" | 
| el15as | 5:158e2951654b | 3 | #include "Gamepad.h" | 
| el15as | 5:158e2951654b | 4 | #include "Player.h" | 
| el15as | 5:158e2951654b | 5 | #include "GameEngine.h" | 
| el15as | 4:1f7f32f3e017 | 6 | |
| el15as | 5:158e2951654b | 7 | N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); | 
| el15as | 5:158e2951654b | 8 | Serial pc(USBTX, USBRX); // tx, rx | 
| el15as | 5:158e2951654b | 9 | Gamepad pad; | 
| el15as | 5:158e2951654b | 10 | GameEngine game; | 
| el15as | 5:158e2951654b | 11 | Player player; | 
| el15as | 4:1f7f32f3e017 | 12 | |
| el15as | 5:158e2951654b | 13 | void update_screen(); | 
| el15as | 4:1f7f32f3e017 | 14 | |
| el15as | 5:158e2951654b | 15 | int main() | 
| el15as | 5:158e2951654b | 16 | { | 
| el15as | 5:158e2951654b | 17 | lcd.init(); | 
| el15as | 5:158e2951654b | 18 | pad.init(); | 
| el15as | 4:1f7f32f3e017 | 19 | |
| el15as | 5:158e2951654b | 20 | lcd.normalMode(); | 
| el15as | 5:158e2951654b | 21 | lcd.setBrightness(1); | 
| el15as | 5:158e2951654b | 22 | game.init(4); | 
| el15as | 5:158e2951654b | 23 | lcd.refresh(); | 
| el15as | 4:1f7f32f3e017 | 24 | |
| el15as | 5:158e2951654b | 25 | while(1) { // loop forever | 
| el15as | 5:158e2951654b | 26 | |
| el15as | 5:158e2951654b | 27 | game.read_input(pad,pc); | 
| el15as | 5:158e2951654b | 28 | game.update(pad, pc, lcd); | 
| el15as | 5:158e2951654b | 29 | game.draw(lcd); | 
| el15as | 5:158e2951654b | 30 | |
| el15as | 5:158e2951654b | 31 | wait(1.0f/10); // 10 fps | 
| el15as | 4:1f7f32f3e017 | 32 | } | 
| el15as | 4:1f7f32f3e017 | 33 | } | 
| el15as | 4:1f7f32f3e017 | 34 | |
| el15as | 4:1f7f32f3e017 | 35 |