A simple demonstration of the DISCO-F746NG LCD, TouchScreen and MCP3221 I2C ADC.

Dependencies:   BSP_DISCO_F746NG LCD_DISCO_F746NG MCP3221 TS_DISCO_F746NG mbed

Fork of DISCO-F746NG_LCD_demo by ST

Committer:
bcostm
Date:
Mon Sep 28 13:34:28 2015 +0000
Revision:
0:b045ca817e2c
Child:
4:16afa8576091
Initial version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:b045ca817e2c 1 #include "mbed.h"
bcostm 0:b045ca817e2c 2 #include "LCD_DISCO_F746NG.h"
bcostm 0:b045ca817e2c 3
bcostm 0:b045ca817e2c 4 LCD_DISCO_F746NG lcd;
bcostm 0:b045ca817e2c 5
bcostm 0:b045ca817e2c 6 DigitalOut led1(LED1);
bcostm 0:b045ca817e2c 7
bcostm 0:b045ca817e2c 8 int main()
bcostm 0:b045ca817e2c 9 {
bcostm 0:b045ca817e2c 10 led1 = 1;
bcostm 0:b045ca817e2c 11
bcostm 0:b045ca817e2c 12 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE);
bcostm 0:b045ca817e2c 13 wait(1);
bcostm 0:b045ca817e2c 14
bcostm 0:b045ca817e2c 15 while(1)
bcostm 0:b045ca817e2c 16 {
bcostm 0:b045ca817e2c 17 lcd.Clear(LCD_COLOR_BLUE);
bcostm 0:b045ca817e2c 18 lcd.SetBackColor(LCD_COLOR_BLUE);
bcostm 0:b045ca817e2c 19 lcd.SetTextColor(LCD_COLOR_WHITE);
bcostm 0:b045ca817e2c 20 wait(0.3);
bcostm 0:b045ca817e2c 21 lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"DISCOVERY STM32F746NG", CENTER_MODE);
bcostm 0:b045ca817e2c 22 wait(1);
bcostm 0:b045ca817e2c 23
bcostm 0:b045ca817e2c 24 lcd.Clear(LCD_COLOR_GREEN);
bcostm 0:b045ca817e2c 25
bcostm 0:b045ca817e2c 26 lcd.SetTextColor(LCD_COLOR_BLUE);
bcostm 0:b045ca817e2c 27 lcd.DrawRect(10, 20, 50, 50);
bcostm 0:b045ca817e2c 28 wait(0.1);
bcostm 0:b045ca817e2c 29 lcd.SetTextColor(LCD_COLOR_BROWN);
bcostm 0:b045ca817e2c 30 lcd.DrawCircle(80, 80, 50);
bcostm 0:b045ca817e2c 31 wait(0.1);
bcostm 0:b045ca817e2c 32 lcd.SetTextColor(LCD_COLOR_YELLOW);
bcostm 0:b045ca817e2c 33 lcd.DrawEllipse(150, 150, 50, 100);
bcostm 0:b045ca817e2c 34 wait(0.1);
bcostm 0:b045ca817e2c 35 lcd.SetTextColor(LCD_COLOR_RED);
bcostm 0:b045ca817e2c 36 lcd.FillCircle(200, 200, 40);
bcostm 0:b045ca817e2c 37 wait(1);
bcostm 0:b045ca817e2c 38
bcostm 0:b045ca817e2c 39 lcd.SetBackColor(LCD_COLOR_ORANGE);
bcostm 0:b045ca817e2c 40 lcd.SetTextColor(LCD_COLOR_CYAN);
bcostm 0:b045ca817e2c 41 lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"HAVE FUN !!!", CENTER_MODE);
bcostm 0:b045ca817e2c 42 wait(1);
bcostm 0:b045ca817e2c 43
bcostm 0:b045ca817e2c 44 led1 = !led1;
bcostm 0:b045ca817e2c 45 }
bcostm 0:b045ca817e2c 46 }