d

Dependencies:   BSP_DISCO_F746NG LCD_DISCO_F746NG 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_F746NG.h"
00003 
00004 LCD_DISCO_F746NG lcd;
00005 
00006 DigitalOut led1(LED1);
00007 
00008 int main()
00009 {  
00010     led1 = 1;
00011 
00012     lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE);
00013     wait(1);
00014   
00015     while(1)
00016     {
00017       lcd.Clear(LCD_COLOR_BLUE);
00018       lcd.SetBackColor(LCD_COLOR_BLUE);
00019       lcd.SetTextColor(LCD_COLOR_WHITE);
00020       wait(0.3);
00021       lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"DISCOVERY STM32F746NG", CENTER_MODE);
00022       wait(1);
00023 
00024       lcd.Clear(LCD_COLOR_GREEN);
00025       
00026       lcd.SetTextColor(LCD_COLOR_BLUE);
00027       lcd.DrawRect(10, 20, 50, 50);
00028       wait(0.1);
00029       lcd.SetTextColor(LCD_COLOR_BROWN);
00030       lcd.DrawCircle(80, 80, 50);
00031       wait(0.1);
00032       lcd.SetTextColor(LCD_COLOR_YELLOW);
00033       lcd.DrawEllipse(150, 150, 50, 100);
00034       wait(0.1);
00035       lcd.SetTextColor(LCD_COLOR_RED);
00036       lcd.FillCircle(200, 200, 40);
00037       wait(1);
00038 
00039       lcd.SetBackColor(LCD_COLOR_ORANGE);
00040       lcd.SetTextColor(LCD_COLOR_CYAN);
00041       lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"HAVE FUN !!!", CENTER_MODE);
00042       wait(1);
00043 
00044       led1 = !led1;
00045     }
00046 }