Projet d'electronique
Dependencies: BSP_DISCO_F429ZI LCD_DISCO_F429ZI mbed
main.cpp@1:8d0030939469, 2018-02-15 (annotated)
- Committer:
- Alex_mln
- Date:
- Thu Feb 15 19:56:57 2018 +0000
- Revision:
- 1:8d0030939469
- Parent:
- 0:e267ad382666
- Child:
- 2:bca1de0a3a91
cc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Alex_mln | 0:e267ad382666 | 1 | #include "mbed.h" |
Alex_mln | 0:e267ad382666 | 2 | #include "LCD_DISCO_F429ZI.h" |
Alex_mln | 0:e267ad382666 | 3 | |
Alex_mln | 0:e267ad382666 | 4 | LCD_DISCO_F429ZI lcd; |
Alex_mln | 0:e267ad382666 | 5 | |
Alex_mln | 1:8d0030939469 | 6 | |
Alex_mln | 1:8d0030939469 | 7 | |
Alex_mln | 1:8d0030939469 | 8 | |
Alex_mln | 1:8d0030939469 | 9 | Romane la nulle |
Alex_mln | 1:8d0030939469 | 10 | |
Alex_mln | 1:8d0030939469 | 11 | |
Alex_mln | 1:8d0030939469 | 12 | |
Alex_mln | 1:8d0030939469 | 13 | |
Alex_mln | 1:8d0030939469 | 14 | |
Alex_mln | 1:8d0030939469 | 15 | |
Alex_mln | 1:8d0030939469 | 16 | |
Alex_mln | 0:e267ad382666 | 17 | DigitalOut led1(LED1); |
Alex_mln | 0:e267ad382666 | 18 | |
Alex_mln | 0:e267ad382666 | 19 | int main() |
Alex_mln | 0:e267ad382666 | 20 | { |
Alex_mln | 0:e267ad382666 | 21 | led1 = 1; |
Alex_mln | 0:e267ad382666 | 22 | |
Alex_mln | 0:e267ad382666 | 23 | BSP_LCD_SetFont(&Font20); |
Alex_mln | 0:e267ad382666 | 24 | lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE); |
Alex_mln | 0:e267ad382666 | 25 | wait(1); |
Alex_mln | 0:e267ad382666 | 26 | |
Alex_mln | 0:e267ad382666 | 27 | while(1) |
Alex_mln | 0:e267ad382666 | 28 | { |
Alex_mln | 0:e267ad382666 | 29 | lcd.Clear(LCD_COLOR_BLUE); |
Alex_mln | 0:e267ad382666 | 30 | lcd.SetBackColor(LCD_COLOR_BLUE); |
Alex_mln | 0:e267ad382666 | 31 | lcd.SetTextColor(LCD_COLOR_WHITE); |
Alex_mln | 0:e267ad382666 | 32 | wait(0.3); |
Alex_mln | 0:e267ad382666 | 33 | lcd.DisplayStringAt(0, LINE(4), (uint8_t *)"DISCOVERY", CENTER_MODE); |
Alex_mln | 0:e267ad382666 | 34 | lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"STM32F429ZI", CENTER_MODE); |
Alex_mln | 0:e267ad382666 | 35 | wait(1); |
Alex_mln | 0:e267ad382666 | 36 | |
Alex_mln | 0:e267ad382666 | 37 | lcd.Clear(LCD_COLOR_GREEN); |
Alex_mln | 0:e267ad382666 | 38 | |
Alex_mln | 0:e267ad382666 | 39 | lcd.SetTextColor(LCD_COLOR_BLUE); |
Alex_mln | 0:e267ad382666 | 40 | lcd.FillRect(10, 20, 50, 50); |
Alex_mln | 0:e267ad382666 | 41 | wait(0.1); |
Alex_mln | 0:e267ad382666 | 42 | lcd.SetTextColor(LCD_COLOR_BROWN); |
Alex_mln | 0:e267ad382666 | 43 | lcd.FillCircle(80, 80, 50); |
Alex_mln | 0:e267ad382666 | 44 | wait(0.1); |
Alex_mln | 0:e267ad382666 | 45 | lcd.SetTextColor(LCD_COLOR_YELLOW); |
Alex_mln | 0:e267ad382666 | 46 | lcd.FillEllipse(150, 150, 50, 100); |
Alex_mln | 0:e267ad382666 | 47 | wait(0.1); |
Alex_mln | 0:e267ad382666 | 48 | lcd.SetTextColor(LCD_COLOR_RED); |
Alex_mln | 0:e267ad382666 | 49 | lcd.FillCircle(200, 200, 40); |
Alex_mln | 0:e267ad382666 | 50 | wait(1); |
Alex_mln | 0:e267ad382666 | 51 | |
Alex_mln | 0:e267ad382666 | 52 | lcd.SetBackColor(LCD_COLOR_ORANGE); |
Alex_mln | 0:e267ad382666 | 53 | lcd.SetTextColor(LCD_COLOR_CYAN); |
Alex_mln | 0:e267ad382666 | 54 | BSP_LCD_SetFont(&Font24); |
Alex_mln | 0:e267ad382666 | 55 | lcd.DisplayStringAt(0, LINE(7), (uint8_t *)"HAVE FUN !!!", CENTER_MODE); |
Alex_mln | 0:e267ad382666 | 56 | wait(1); |
Alex_mln | 0:e267ad382666 | 57 | |
Alex_mln | 0:e267ad382666 | 58 | led1 = !led1; |
Alex_mln | 0:e267ad382666 | 59 | wait(0.5); |
Alex_mln | 0:e267ad382666 | 60 | } |
Alex_mln | 0:e267ad382666 | 61 | } |
Alex_mln | 0:e267ad382666 | 62 |