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