1
Dependencies: BSP_DISCO_F746NG LCD_DISCO_F746NG mbed
main.cpp@0:c61dcab80772, 2016-03-15 (annotated)
- Committer:
- love750s
- Date:
- Tue Mar 15 01:37:37 2016 +0000
- Revision:
- 0:c61dcab80772
0
;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
love750s | 0:c61dcab80772 | 1 | #include "mbed.h" |
love750s | 0:c61dcab80772 | 2 | #include "LCD_DISCO_F746NG.h" |
love750s | 0:c61dcab80772 | 3 | |
love750s | 0:c61dcab80772 | 4 | LCD_DISCO_F746NG lcd; |
love750s | 0:c61dcab80772 | 5 | |
love750s | 0:c61dcab80772 | 6 | DigitalOut led1(LED1); |
love750s | 0:c61dcab80772 | 7 | |
love750s | 0:c61dcab80772 | 8 | int main() |
love750s | 0:c61dcab80772 | 9 | { |
love750s | 0:c61dcab80772 | 10 | led1 = 1; |
love750s | 0:c61dcab80772 | 11 | |
love750s | 0:c61dcab80772 | 12 | lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE); |
love750s | 0:c61dcab80772 | 13 | wait(1); |
love750s | 0:c61dcab80772 | 14 | |
love750s | 0:c61dcab80772 | 15 | while(1) |
love750s | 0:c61dcab80772 | 16 | { |
love750s | 0:c61dcab80772 | 17 | lcd.Clear(LCD_COLOR_BLUE); |
love750s | 0:c61dcab80772 | 18 | lcd.SetBackColor(LCD_COLOR_BLUE); |
love750s | 0:c61dcab80772 | 19 | lcd.SetTextColor(LCD_COLOR_WHITE); |
love750s | 0:c61dcab80772 | 20 | wait(0.3); |
love750s | 0:c61dcab80772 | 21 | lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"DISCOVERY STM32F746NG", CENTER_MODE); |
love750s | 0:c61dcab80772 | 22 | wait(1); |
love750s | 0:c61dcab80772 | 23 | |
love750s | 0:c61dcab80772 | 24 | lcd.Clear(LCD_COLOR_GREEN); |
love750s | 0:c61dcab80772 | 25 | |
love750s | 0:c61dcab80772 | 26 | lcd.SetTextColor(LCD_COLOR_BLUE); |
love750s | 0:c61dcab80772 | 27 | lcd.DrawRect(10, 20, 50, 50); |
love750s | 0:c61dcab80772 | 28 | wait(0.1); |
love750s | 0:c61dcab80772 | 29 | lcd.SetTextColor(LCD_COLOR_BROWN); |
love750s | 0:c61dcab80772 | 30 | lcd.DrawCircle(80, 80, 50); |
love750s | 0:c61dcab80772 | 31 | wait(0.1); |
love750s | 0:c61dcab80772 | 32 | lcd.SetTextColor(LCD_COLOR_YELLOW); |
love750s | 0:c61dcab80772 | 33 | lcd.DrawEllipse(150, 150, 50, 100); |
love750s | 0:c61dcab80772 | 34 | wait(0.1); |
love750s | 0:c61dcab80772 | 35 | lcd.SetTextColor(LCD_COLOR_RED); |
love750s | 0:c61dcab80772 | 36 | lcd.FillCircle(200, 200, 40); |
love750s | 0:c61dcab80772 | 37 | wait(1); |
love750s | 0:c61dcab80772 | 38 | |
love750s | 0:c61dcab80772 | 39 | lcd.SetBackColor(LCD_COLOR_ORANGE); |
love750s | 0:c61dcab80772 | 40 | lcd.SetTextColor(LCD_COLOR_CYAN); |
love750s | 0:c61dcab80772 | 41 | lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"HAVE FUN !!!", CENTER_MODE); |
love750s | 0:c61dcab80772 | 42 | wait(1); |
love750s | 0:c61dcab80772 | 43 | |
love750s | 0:c61dcab80772 | 44 | led1 = !led1; |
love750s | 0:c61dcab80772 | 45 | } |
love750s | 0:c61dcab80772 | 46 | } |