LCD TS
Dependencies: mbed LCD_DISCO_F746NG BSP_DISCO_F746NG
main.cpp@7:896fb491fbfb, 2022-06-16 (annotated)
- Committer:
- James1208
- Date:
- Thu Jun 16 08:53:35 2022 +0000
- Revision:
- 7:896fb491fbfb
- Parent:
- 3:0b57082839f2
commit
Who changed what in which revision?
User | Revision | Line number | New 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 | |
James1208 | 7:896fb491fbfb | 6 | DigitalOut led1(LED1); |
bcostm | 0:b045ca817e2c | 7 | |
bcostm | 0:b045ca817e2c | 8 | int main() |
James1208 | 7:896fb491fbfb | 9 | { |
James1208 | 7:896fb491fbfb | 10 | led1 = 1; |
bcostm | 0:b045ca817e2c | 11 | |
James1208 | 7:896fb491fbfb | 12 | lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE); |
James1208 | 7:896fb491fbfb | 13 | wait(1); |
James1208 | 7:896fb491fbfb | 14 | |
James1208 | 7:896fb491fbfb | 15 | while(1) |
James1208 | 7:896fb491fbfb | 16 | { |
James1208 | 7:896fb491fbfb | 17 | lcd.Clear(LCD_COLOR_BLUE); |
James1208 | 7:896fb491fbfb | 18 | lcd.SetBackColor(LCD_COLOR_BLUE); |
James1208 | 7:896fb491fbfb | 19 | lcd.SetTextColor(LCD_COLOR_WHITE); |
James1208 | 7:896fb491fbfb | 20 | wait(0.3); |
James1208 | 7:896fb491fbfb | 21 | lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"DISCOVERY STM32F746NG", CENTER_MODE); |
James1208 | 7:896fb491fbfb | 22 | wait(1); |
bcostm | 0:b045ca817e2c | 23 | |
James1208 | 7:896fb491fbfb | 24 | lcd.Clear(LCD_COLOR_GREEN); |
James1208 | 7:896fb491fbfb | 25 | |
James1208 | 7:896fb491fbfb | 26 | lcd.SetTextColor(LCD_COLOR_BLUE); |
James1208 | 7:896fb491fbfb | 27 | lcd.DrawRect(10, 20, 50, 50); |
James1208 | 7:896fb491fbfb | 28 | wait(0.1); |
James1208 | 7:896fb491fbfb | 29 | lcd.SetTextColor(LCD_COLOR_BROWN); |
James1208 | 7:896fb491fbfb | 30 | lcd.DrawCircle(80, 80, 50); |
James1208 | 7:896fb491fbfb | 31 | wait(0.1); |
James1208 | 7:896fb491fbfb | 32 | lcd.SetTextColor(LCD_COLOR_YELLOW); |
James1208 | 7:896fb491fbfb | 33 | lcd.DrawEllipse(150, 150, 50, 100); |
James1208 | 7:896fb491fbfb | 34 | wait(0.1); |
James1208 | 7:896fb491fbfb | 35 | lcd.SetTextColor(LCD_COLOR_RED); |
James1208 | 7:896fb491fbfb | 36 | lcd.FillCircle(200, 200, 40); |
James1208 | 7:896fb491fbfb | 37 | wait(1); |
bcostm | 0:b045ca817e2c | 38 | |
James1208 | 7:896fb491fbfb | 39 | lcd.SetBackColor(LCD_COLOR_ORANGE); |
James1208 | 7:896fb491fbfb | 40 | lcd.SetTextColor(LCD_COLOR_CYAN); |
James1208 | 7:896fb491fbfb | 41 | lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"HAVE FUN !!!", CENTER_MODE); |
James1208 | 7:896fb491fbfb | 42 | wait(1); |
bcostm | 0:b045ca817e2c | 43 | |
James1208 | 7:896fb491fbfb | 44 | led1 = !led1; |
James1208 | 7:896fb491fbfb | 45 | } |
James1208 | 7:896fb491fbfb | 46 | } |