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