In this tutorial we will use data prepared in previous article.
First we need to finish part 1 and part 2 of STEmWin tutorial to have display ready.
After that we need to get Demo.c into our project, we do this by dragging file from file explorer on our PC to our src folder in the root of our project:
Then we include this file:
1 2 3 4 5 6 |
/* USER CODE BEGIN Includes */ #include "stm32f429i_discovery.h" #include "stm32f429i_discovery_lcd.h" #include "stm32f429i_discovery_ts.h" #include "Demo.c" /* USER CODE END Includes */ |
We need some adjustments inside Demo.c.
- we need to delete everything before static GUI_CONST_STORAGE unsigned long _acDemo[] = {. We leave the commented text for the sake of Segger licence
- we need to change static GUI_CONST_STORAGE unsigned long to static const unsigned long
- we need to delete everything after GUI_CONST_STORAGE GUI_BITMAP bmDemo = { to the end of file comment
Finally we just need to add a few lines of code (for loop) inside main.c:
1 2 3 4 5 6 7 |
BSP_LCD_Clear(LCD_COLOR_GREEN); BSP_LCD_DrawRect(80, 80, 80, 40); for(unsigned int a = 0; a < (76800); a++) { BSP_LCD_DrawPixel(a % 240, a / 240, _acDemo[a]); } /* USER CODE END 2 */ |
With this done, after compiling and programming we have nice 3D looking, sandy green background on our display.