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 4DGL-uLCD-SE MMA8452
main.cpp@0:2f4225a589d1, 2019-03-10 (annotated)
- Committer:
- Yehowshua
- Date:
- Sun Mar 10 05:28:18 2019 +0000
- Revision:
- 0:2f4225a589d1
- Child:
- 1:47394b602697
First Commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Yehowshua | 0:2f4225a589d1 | 1 | #include "mbed.h" |
| Yehowshua | 0:2f4225a589d1 | 2 | #include "uLCD_4DGL.h" |
| Yehowshua | 0:2f4225a589d1 | 3 | #include "main_character.h" |
| Yehowshua | 0:2f4225a589d1 | 4 | |
| Yehowshua | 0:2f4225a589d1 | 5 | uLCD_4DGL uLCD(p9, p10, p11); // serial tx, serial rx, reset pin; |
| Yehowshua | 0:2f4225a589d1 | 6 | |
| Yehowshua | 0:2f4225a589d1 | 7 | |
| Yehowshua | 0:2f4225a589d1 | 8 | extern void main_character_constructor(void); |
| Yehowshua | 0:2f4225a589d1 | 9 | extern sprite main_character; |
| Yehowshua | 0:2f4225a589d1 | 10 | |
| Yehowshua | 0:2f4225a589d1 | 11 | DigitalOut myled(LED1); |
| Yehowshua | 0:2f4225a589d1 | 12 | |
| Yehowshua | 0:2f4225a589d1 | 13 | int main() { |
| Yehowshua | 0:2f4225a589d1 | 14 | //increase BAUD rate |
| Yehowshua | 0:2f4225a589d1 | 15 | uLCD.baudrate(3000000); |
| Yehowshua | 0:2f4225a589d1 | 16 | uLCD.background_color(WHITE); |
| Yehowshua | 0:2f4225a589d1 | 17 | |
| Yehowshua | 0:2f4225a589d1 | 18 | main_character_constructor(); |
| Yehowshua | 0:2f4225a589d1 | 19 | //main_character_i(); |
| Yehowshua | 0:2f4225a589d1 | 20 | uLCD.BLIT(0,0,16,16,main_character.skins); |
| Yehowshua | 0:2f4225a589d1 | 21 | uLCD.BLIT(15,15,16,16,main_character.skins); |
| Yehowshua | 0:2f4225a589d1 | 22 | uLCD.BLIT(31,31,16,16,main_character.skins); |
| Yehowshua | 0:2f4225a589d1 | 23 | while(1) { |
| Yehowshua | 0:2f4225a589d1 | 24 | myled = 1; |
| Yehowshua | 0:2f4225a589d1 | 25 | wait(0.2); |
| Yehowshua | 0:2f4225a589d1 | 26 | myled = 0; |
| Yehowshua | 0:2f4225a589d1 | 27 | wait(0.2); |
| Yehowshua | 0:2f4225a589d1 | 28 | } |
| Yehowshua | 0:2f4225a589d1 | 29 | } |