Projet d'electronique
Dependencies: BSP_DISCO_F429ZI LCD_DISCO_F429ZI mbed
main.cpp@5:f8092b880eec, 2018-02-17 (annotated)
- Committer:
- Alex_mln
- Date:
- Sat Feb 17 14:26:58 2018 +0000
- Revision:
- 5:f8092b880eec
- Parent:
- 4:78121c0d5a5e
- Child:
- 6:58ef8c8a2d8e
Laisser un commentaire
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 | 5:f8092b880eec | 6 | Vous pouvez ecrire votre programme |
Alex_mln | 5:f8092b880eec | 7 | |
Alex_mln | 1:8d0030939469 | 8 | |
Alex_mln | 3:cf3606d19cfe | 9 | Test 1 |
toplexil74 | 4:78121c0d5a5e | 10 | Test 2 |
Alex_mln | 1:8d0030939469 | 11 | |
Alex_mln | 2:bca1de0a3a91 | 12 | Romane la nulle stp |
Alex_mln | 1:8d0030939469 | 13 | |
Alex_mln | 1:8d0030939469 | 14 | |
Alex_mln | 1:8d0030939469 | 15 | |
Alex_mln | 1:8d0030939469 | 16 | |
Alex_mln | 1:8d0030939469 | 17 | |
Alex_mln | 1:8d0030939469 | 18 | |
Alex_mln | 1:8d0030939469 | 19 | |
Alex_mln | 0:e267ad382666 | 20 | DigitalOut led1(LED1); |
Alex_mln | 0:e267ad382666 | 21 | |
Alex_mln | 0:e267ad382666 | 22 | int main() |
Alex_mln | 0:e267ad382666 | 23 | { |
Alex_mln | 0:e267ad382666 | 24 | led1 = 1; |
Alex_mln | 0:e267ad382666 | 25 | |
Alex_mln | 0:e267ad382666 | 26 | BSP_LCD_SetFont(&Font20); |
Alex_mln | 0:e267ad382666 | 27 | lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE); |
Alex_mln | 0:e267ad382666 | 28 | wait(1); |
Alex_mln | 0:e267ad382666 | 29 | |
Alex_mln | 0:e267ad382666 | 30 | while(1) |
Alex_mln | 0:e267ad382666 | 31 | { |
Alex_mln | 0:e267ad382666 | 32 | lcd.Clear(LCD_COLOR_BLUE); |
Alex_mln | 0:e267ad382666 | 33 | lcd.SetBackColor(LCD_COLOR_BLUE); |
Alex_mln | 0:e267ad382666 | 34 | lcd.SetTextColor(LCD_COLOR_WHITE); |
Alex_mln | 0:e267ad382666 | 35 | wait(0.3); |
Alex_mln | 0:e267ad382666 | 36 | lcd.DisplayStringAt(0, LINE(4), (uint8_t *)"DISCOVERY", CENTER_MODE); |
Alex_mln | 0:e267ad382666 | 37 | lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"STM32F429ZI", CENTER_MODE); |
Alex_mln | 0:e267ad382666 | 38 | wait(1); |
Alex_mln | 0:e267ad382666 | 39 | |
Alex_mln | 0:e267ad382666 | 40 | lcd.Clear(LCD_COLOR_GREEN); |
Alex_mln | 0:e267ad382666 | 41 | |
Alex_mln | 0:e267ad382666 | 42 | lcd.SetTextColor(LCD_COLOR_BLUE); |
Alex_mln | 0:e267ad382666 | 43 | lcd.FillRect(10, 20, 50, 50); |
Alex_mln | 0:e267ad382666 | 44 | wait(0.1); |
Alex_mln | 0:e267ad382666 | 45 | lcd.SetTextColor(LCD_COLOR_BROWN); |
Alex_mln | 0:e267ad382666 | 46 | lcd.FillCircle(80, 80, 50); |
Alex_mln | 0:e267ad382666 | 47 | wait(0.1); |
Alex_mln | 0:e267ad382666 | 48 | lcd.SetTextColor(LCD_COLOR_YELLOW); |
Alex_mln | 0:e267ad382666 | 49 | lcd.FillEllipse(150, 150, 50, 100); |
Alex_mln | 0:e267ad382666 | 50 | wait(0.1); |
Alex_mln | 0:e267ad382666 | 51 | lcd.SetTextColor(LCD_COLOR_RED); |
Alex_mln | 0:e267ad382666 | 52 | lcd.FillCircle(200, 200, 40); |
Alex_mln | 0:e267ad382666 | 53 | wait(1); |
Alex_mln | 0:e267ad382666 | 54 | |
Alex_mln | 0:e267ad382666 | 55 | lcd.SetBackColor(LCD_COLOR_ORANGE); |
Alex_mln | 0:e267ad382666 | 56 | lcd.SetTextColor(LCD_COLOR_CYAN); |
Alex_mln | 0:e267ad382666 | 57 | BSP_LCD_SetFont(&Font24); |
Alex_mln | 0:e267ad382666 | 58 | lcd.DisplayStringAt(0, LINE(7), (uint8_t *)"HAVE FUN !!!", CENTER_MODE); |
Alex_mln | 0:e267ad382666 | 59 | wait(1); |
Alex_mln | 0:e267ad382666 | 60 | |
Alex_mln | 0:e267ad382666 | 61 | led1 = !led1; |
Alex_mln | 0:e267ad382666 | 62 | wait(0.5); |
Alex_mln | 0:e267ad382666 | 63 | } |
Alex_mln | 0:e267ad382666 | 64 | } |
Alex_mln | 0:e267ad382666 | 65 |