Basic example showing how to drive the LCD.

Dependencies:   BSP_DISCO_F429ZI LCD_DISCO_F429ZI mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "LCD_DISCO_F429ZI.h"
00003 
00004 LCD_DISCO_F429ZI lcd;
00005 
00006 DigitalOut led1(LED1);
00007 
00008 int main()
00009 {      
00010     led1 = 1;
00011   
00012     BSP_LCD_SetFont(&Font20);
00013     lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE);
00014     wait(1);
00015   
00016     while(1)
00017     {      
00018       lcd.Clear(LCD_COLOR_BLUE);
00019       lcd.SetBackColor(LCD_COLOR_BLUE);
00020       lcd.SetTextColor(LCD_COLOR_WHITE);
00021       wait(0.3);
00022       lcd.DisplayStringAt(0, LINE(4), (uint8_t *)"DISCOVERY", CENTER_MODE);
00023       lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"STM32F429ZI", CENTER_MODE);
00024       wait(1);
00025 
00026       lcd.Clear(LCD_COLOR_GREEN);
00027       
00028       lcd.SetTextColor(LCD_COLOR_BLUE);
00029       lcd.FillRect(10, 20, 50, 50);
00030       wait(0.1);
00031       lcd.SetTextColor(LCD_COLOR_BROWN);
00032       lcd.FillCircle(80, 80, 50);
00033       wait(0.1);
00034       lcd.SetTextColor(LCD_COLOR_YELLOW);
00035       lcd.FillEllipse(150, 150, 50, 100);
00036       wait(0.1);
00037       lcd.SetTextColor(LCD_COLOR_RED);
00038       lcd.FillCircle(200, 200, 40);
00039       wait(1);
00040 
00041       lcd.SetBackColor(LCD_COLOR_ORANGE);
00042       lcd.SetTextColor(LCD_COLOR_CYAN);
00043       BSP_LCD_SetFont(&Font24);
00044       lcd.DisplayStringAt(0, LINE(7), (uint8_t *)"HAVE FUN !!!", CENTER_MODE);
00045       wait(1);
00046 
00047       led1 = !led1;
00048       wait(0.5);
00049     }
00050 }
00051