Nikita Ivanykov
/
LAB_DISPLAY
7
Diff: main.cpp
- Revision:
- 3:9909607749dd
- Parent:
- 2:82f5f57eac91
diff -r 82f5f57eac91 -r 9909607749dd main.cpp --- a/main.cpp Sun Nov 05 14:51:21 2017 +0000 +++ b/main.cpp Wed Nov 13 10:28:49 2019 +0000 @@ -1,7 +1,7 @@ #include "mbed.h" #include "ILI9341_Defines.h" -SPI spi_dev(PB_15, PB_14, PB_13); +SPI spi_dev(PB_15, PB_14, PB_13, PB_12); DigitalOut cs(PC_4); DigitalOut ao(PB_3); uint8_t tarr[1024]; @@ -14,6 +14,7 @@ cs = 1; } + void writedata(uint8_t data) { cs = 0; ao = 1; @@ -49,9 +50,94 @@ for (int i = 0; i < 1024; i++) { tarr[i] = 0; } + + + for (int i = 0; i < 32; i++) { + writeColorData(tarr, 1024); + } + + + while(1) { + setAddress(64, 64, 127, 127); + for (int i = 0; i < 1024; i++) { + tarr[i] = 10; + } + + + for (int i = 0; i < 32; i++) { + writeColorData(tarr, 1024); + } + setAddress(0, 0, 64, 64); + for (int i = 0; i < 1024; i++) { + tarr[i*2] = 0xF8; + tarr[i*2+1] = 0x00; + } + + + for (int i = 0; i < 32; i++) { + writeColorData(tarr, 1024); + } + setAddress(0, 64, 64, 127); + for (int i = 0; i < 1024; i++) { + tarr[i] = 07E0; + } + + + for (int i = 0; i < 32; i++) { + writeColorData(tarr, 1024); + } + setAddress(64, 0, 127, 64); + for (int i = 0; i < 1024; i++) { + tarr[i] = 40; + } + + for (int i = 0; i < 32; i++) { writeColorData(tarr, 1024); } - while(1) { + + + wait(0.5); + setAddress(64, 64, 127, 127); + for (int i = 0; i < 1024; i++) { + tarr[i] = 0; + } + + + for (int i = 0; i < 32; i++) { + writeColorData(tarr, 1024); + } + wait(0.5); + setAddress(0, 0, 64, 64); + for (int i = 0; i < 1024; i++) { + tarr[i] = 0; + } + + + for (int i = 0; i < 32; i++) { + writeColorData(tarr, 1024); + } + wait(0.5); + setAddress(0, 64, 64, 127); + for (int i = 0; i < 1024; i++) { + tarr[i] = 0; + } + + + for (int i = 0; i < 32; i++) { + writeColorData(tarr, 1024); + } + wait(0.5); + setAddress(64, 0, 127, 64); + for (int i = 0; i < 1024; i++) { + tarr[i] = 0; + } + + + for (int i = 0; i < 32; i++) { + writeColorData(tarr, 1024); + } + + } }