![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
f
Dependencies: mbed 4DGL-uLCD-SE MMA8452
graphics.cpp@0:8e3b9bb1084a, 2022-03-10 (annotated)
- Committer:
- lballard9
- Date:
- Thu Mar 10 05:18:13 2022 +0000
- Revision:
- 0:8e3b9bb1084a
shell rev b;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lballard9 | 0:8e3b9bb1084a | 1 | #include "graphics.h" |
lballard9 | 0:8e3b9bb1084a | 2 | |
lballard9 | 0:8e3b9bb1084a | 3 | #include "globals.h" |
lballard9 | 0:8e3b9bb1084a | 4 | |
lballard9 | 0:8e3b9bb1084a | 5 | //Example sprite, DON'T USE THIS SPRITE!! |
lballard9 | 0:8e3b9bb1084a | 6 | void draw_sprite() |
lballard9 | 0:8e3b9bb1084a | 7 | { |
lballard9 | 0:8e3b9bb1084a | 8 | int new_piskel_data[256] = { |
lballard9 | 0:8e3b9bb1084a | 9 | |
lballard9 | 0:8e3b9bb1084a | 10 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 11 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 12 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 13 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 14 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 15 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 16 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 17 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, |
lballard9 | 0:8e3b9bb1084a | 18 | 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0xffd000ff, |
lballard9 | 0:8e3b9bb1084a | 19 | 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0xffd000ff, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 20 | 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 21 | 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 22 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0xffd000ff, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 23 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffd000ff, 0xffd000ff, 0xffd000ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 24 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, |
lballard9 | 0:8e3b9bb1084a | 25 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 |
lballard9 | 0:8e3b9bb1084a | 26 | |
lballard9 | 0:8e3b9bb1084a | 27 | }; |
lballard9 | 0:8e3b9bb1084a | 28 | |
lballard9 | 0:8e3b9bb1084a | 29 | uLCD.BLIT(0,0,16,16, new_piskel_data); |
lballard9 | 0:8e3b9bb1084a | 30 | } |
lballard9 | 0:8e3b9bb1084a | 31 | |
lballard9 | 0:8e3b9bb1084a | 32 | /* |
lballard9 | 0:8e3b9bb1084a | 33 | * Helper function to differentiate where the |
lballard9 | 0:8e3b9bb1084a | 34 | * keyboard is on the screen. |
lballard9 | 0:8e3b9bb1084a | 35 | */ |
lballard9 | 0:8e3b9bb1084a | 36 | void draw_lower_status() |
lballard9 | 0:8e3b9bb1084a | 37 | { |
lballard9 | 0:8e3b9bb1084a | 38 | // Draw top border of status bar |
lballard9 | 0:8e3b9bb1084a | 39 | uLCD.line(0, 118, 127, 118, GREEN); |
lballard9 | 0:8e3b9bb1084a | 40 | |
lballard9 | 0:8e3b9bb1084a | 41 | // Add other status info drawing code here |
lballard9 | 0:8e3b9bb1084a | 42 | } |
lballard9 | 0:8e3b9bb1084a | 43 | |
lballard9 | 0:8e3b9bb1084a | 44 |