Marcelo Costanzo Miranda
/
ST7920_TEST_sem_lib_2
ST7920 Testes
main.cpp@1:08481151e25e, 2020-12-14 (annotated)
- Committer:
- Marcelocostanzo
- Date:
- Mon Dec 14 19:10:22 2020 +0000
- Revision:
- 1:08481151e25e
- Parent:
- 0:d93bec0d412f
- Child:
- 2:5bcfb7105fa2
Versao de testes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Marcelocostanzo | 1:08481151e25e | 1 | /* |
Marcelocostanzo | 1:08481151e25e | 2 | * ATENÇÃO ST7920_CLEAR DESATIVA O MODO GRÁFICO |
Marcelocostanzo | 1:08481151e25e | 3 | * |
Marcelocostanzo | 1:08481151e25e | 4 | * |
Marcelocostanzo | 1:08481151e25e | 5 | */ |
Marcelocostanzo | 0:d93bec0d412f | 6 | |
Marcelocostanzo | 1:08481151e25e | 7 | #include "mbed.h" |
Marcelocostanzo | 1:08481151e25e | 8 | #include "ST7920.h" |
Marcelocostanzo | 0:d93bec0d412f | 9 | |
Marcelocostanzo | 0:d93bec0d412f | 10 | Serial pc(USBTX, USBRX); |
Marcelocostanzo | 0:d93bec0d412f | 11 | |
Marcelocostanzo | 0:d93bec0d412f | 12 | int main() |
Marcelocostanzo | 0:d93bec0d412f | 13 | { |
Marcelocostanzo | 1:08481151e25e | 14 | unsigned char texto[]={'O','l','a','!', ' ', 'S', 'T', '7', '9', '2', '0'}; |
Marcelocostanzo | 0:d93bec0d412f | 15 | pc.printf("OI \n\r"); |
Marcelocostanzo | 0:d93bec0d412f | 16 | |
Marcelocostanzo | 1:08481151e25e | 17 | ST7920_Init(); |
Marcelocostanzo | 1:08481151e25e | 18 | wait_ms(100); |
Marcelocostanzo | 0:d93bec0d412f | 19 | |
Marcelocostanzo | 1:08481151e25e | 20 | //ST7920_Clear(); |
Marcelocostanzo | 1:08481151e25e | 21 | //wait_ms(100); |
Marcelocostanzo | 0:d93bec0d412f | 22 | |
Marcelocostanzo | 1:08481151e25e | 23 | //ST7920_SetGraphicsMode(); |
Marcelocostanzo | 1:08481151e25e | 24 | //wait_ms(100); |
Marcelocostanzo | 0:d93bec0d412f | 25 | |
Marcelocostanzo | 1:08481151e25e | 26 | //ST7920_Clear(); |
Marcelocostanzo | 1:08481151e25e | 27 | //wait_ms(100); |
Marcelocostanzo | 1:08481151e25e | 28 | |
Marcelocostanzo | 1:08481151e25e | 29 | //ST7920_SetGraphicsMode(); |
Marcelocostanzo | 0:d93bec0d412f | 30 | |
Marcelocostanzo | 1:08481151e25e | 31 | //ST7920_Clear(); |
Marcelocostanzo | 1:08481151e25e | 32 | |
Marcelocostanzo | 1:08481151e25e | 33 | //ST7920_DrawHorizontalLine(0, 0, 100); |
Marcelocostanzo | 1:08481151e25e | 34 | //wait_ms(100); |
Marcelocostanzo | 1:08481151e25e | 35 | |
Marcelocostanzo | 1:08481151e25e | 36 | //ST7920_DrawVerticalLine(0, 0, 50); |
Marcelocostanzo | 1:08481151e25e | 37 | //wait_ms(100); |
Marcelocostanzo | 0:d93bec0d412f | 38 | |
Marcelocostanzo | 1:08481151e25e | 39 | //ST7920_SetTextMode(); |
Marcelocostanzo | 1:08481151e25e | 40 | //wait_ms(100); |
Marcelocostanzo | 0:d93bec0d412f | 41 | |
Marcelocostanzo | 1:08481151e25e | 42 | ST7920_Clear(); |
Marcelocostanzo | 1:08481151e25e | 43 | //wait_ms(100); |
Marcelocostanzo | 0:d93bec0d412f | 44 | |
Marcelocostanzo | 1:08481151e25e | 45 | ST7920_DisplayString(1, 1, texto, sizeof(texto)); |
Marcelocostanzo | 1:08481151e25e | 46 | //wait_ms(100); |
Marcelocostanzo | 1:08481151e25e | 47 | |
Marcelocostanzo | 0:d93bec0d412f | 48 | while(1) |
Marcelocostanzo | 0:d93bec0d412f | 49 | { |
Marcelocostanzo | 0:d93bec0d412f | 50 | |
Marcelocostanzo | 0:d93bec0d412f | 51 | } |
Marcelocostanzo | 0:d93bec0d412f | 52 | } |
Marcelocostanzo | 1:08481151e25e | 53 |