LCD demo using ST BSP driver
Dependencies: BSP_DISCO_L496AG
Revision 3:ff6ab501ecb0, committed 2018-03-26
- Comitter:
- bcostm
- Date:
- Mon Mar 26 14:34:09 2018 +0200
- Parent:
- 2:30ff9afbc2a9
- Child:
- 4:6831ef31324d
- Commit message:
- Update main
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Mar 26 13:11:17 2018 +0200 +++ b/main.cpp Mon Mar 26 14:34:09 2018 +0200 @@ -5,16 +5,39 @@ { BSP_LCD_Init(); - /* Clear the LCD */ - BSP_LCD_Clear(LCD_COLOR_WHITE); + while(1) { + BSP_LCD_SetFont(&Font12); + BSP_LCD_Clear(LCD_COLOR_MAGENTA); + BSP_LCD_SetBackColor(LCD_COLOR_MAGENTA); + BSP_LCD_SetTextColor(LCD_COLOR_ORANGE); + BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE); + BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE); + BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT12", CENTER_MODE); + wait(2); + BSP_LCD_SetFont(&Font16); + BSP_LCD_Clear(LCD_COLOR_RED); + BSP_LCD_SetBackColor(LCD_COLOR_RED); + BSP_LCD_SetTextColor(LCD_COLOR_YELLOW); + BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE); + BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE); + BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT16", CENTER_MODE); + wait(2); + BSP_LCD_SetFont(&Font20); + BSP_LCD_Clear(LCD_COLOR_GREEN); + BSP_LCD_SetBackColor(LCD_COLOR_GREEN); + BSP_LCD_SetTextColor(LCD_COLOR_BLACK); + BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE); + BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE); + BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT20", CENTER_MODE); + wait(2); + BSP_LCD_Clear(LCD_COLOR_BLUE); + BSP_LCD_SetBackColor(LCD_COLOR_BLUE); + BSP_LCD_SetTextColor(LCD_COLOR_WHITE); + BSP_LCD_SetFont(&Font24); + BSP_LCD_DisplayStringAt(0, LINE(4), (uint8_t *)"DISCO_L496AG", CENTER_MODE); + BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"LCD DEMO", CENTER_MODE); + BSP_LCD_DisplayStringAt(0, LINE(6), (uint8_t *)"FONT24", CENTER_MODE); + wait(2); + } - BSP_LCD_DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE); - wait(2); - BSP_LCD_Clear(LCD_COLOR_GREEN); - BSP_LCD_SetBackColor(LCD_COLOR_GREEN); - BSP_LCD_SetTextColor(LCD_COLOR_BLACK); - BSP_LCD_DisplayStringAt(0, LINE(5), (uint8_t *)"DISCO_L496AG", CENTER_MODE); - - while(1) { - } }