2
Dependencies: mbed LCD_DISCO_F746NG BSP_DISCO_F746NG
main.cpp@4:abedada304bf, 2017-06-08 (annotated)
- Committer:
- jeromecoutant
- Date:
- Thu Jun 08 13:47:01 2017 +0000
- Revision:
- 4:abedada304bf
- Parent:
- 0:b045ca817e2c
Update libs
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 | |
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 | } |