Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp@0:8bb6839e4133, 2020-03-19 (annotated)
- Committer:
- eitanallal
- Date:
- Thu Mar 19 07:31:08 2020 +0000
- Revision:
- 0:8bb6839e4133
YO
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| eitanallal | 0:8bb6839e4133 | 1 | #include "mbed.h" |
| eitanallal | 0:8bb6839e4133 | 2 | #include "fonction.h" |
| eitanallal | 0:8bb6839e4133 | 3 | #include "fonction.c" |
| eitanallal | 0:8bb6839e4133 | 4 | |
| eitanallal | 0:8bb6839e4133 | 5 | DigitalOut myled(LED1); |
| eitanallal | 0:8bb6839e4133 | 6 | |
| eitanallal | 0:8bb6839e4133 | 7 | int main() { |
| eitanallal | 0:8bb6839e4133 | 8 | BSP_LCD_Init(); |
| eitanallal | 0:8bb6839e4133 | 9 | BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS); |
| eitanallal | 0:8bb6839e4133 | 10 | BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER); |
| eitanallal | 0:8bb6839e4133 | 11 | |
| eitanallal | 0:8bb6839e4133 | 12 | while (1) {S |
| eitanallal | 0:8bb6839e4133 | 13 | BSP_LCD_Clear(LCD_COLOR_BLACK); |
| eitanallal | 0:8bb6839e4133 | 14 | BSP_LCD_SetFont(&LCD_DEFAULT_FONT); |
| eitanallal | 0:8bb6839e4133 | 15 | BSP_LCD_SetBackColor(LCD_COLOR_WHITE); |
| eitanallal | 0:8bb6839e4133 | 16 | BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE); |
| eitanallal | 0:8bb6839e4133 | 17 | |
| eitanallal | 0:8bb6839e4133 | 18 | BSP_LCD_DisplayStringAt(0, 1, (uint8_t *)"Bienvenue sur notre projeeeeetttttt !!!", CENTER_MODE); |
| eitanallal | 0:8bb6839e4133 | 19 | HAL_Delay(5000); |
| eitanallal | 0:8bb6839e4133 | 20 | |
| eitanallal | 0:8bb6839e4133 | 21 | |
| eitanallal | 0:8bb6839e4133 | 22 | /* while(1) { |
| eitanallal | 0:8bb6839e4133 | 23 | myled = 1; // LED is ON |
| eitanallal | 0:8bb6839e4133 | 24 | wait(0.2); // 200 ms |
| eitanallal | 0:8bb6839e4133 | 25 | myled = 0; // LED is OFF |
| eitanallal | 0:8bb6839e4133 | 26 | wait(1.0); // 1 sec |
| eitanallal | 0:8bb6839e4133 | 27 | }*/ |
| eitanallal | 0:8bb6839e4133 | 28 | int posx=0; |
| eitanallal | 0:8bb6839e4133 | 29 | int posy=0; |
| eitanallal | 0:8bb6839e4133 | 30 | int* matx=NULL; |
| eitanallal | 0:8bb6839e4133 | 31 | int* maty=NULL; |
| eitanallal | 0:8bb6839e4133 | 32 | int rang=0; |
| eitanallal | 0:8bb6839e4133 | 33 | while(1){ |
| eitanallal | 0:8bb6839e4133 | 34 | //L'acceleromètre doit donner accx et accy |
| eitanallal | 0:8bb6839e4133 | 35 | int accx=0; |
| eitanallal | 0:8bb6839e4133 | 36 | int accy=0; |
| eitanallal | 0:8bb6839e4133 | 37 | sortiex(posx,accx); |
| eitanallal | 0:8bb6839e4133 | 38 | sortiey(posy,accy); |
| eitanallal | 0:8bb6839e4133 | 39 | wait(TMP); |
| eitanallal | 0:8bb6839e4133 | 40 | rang=rang+1; |
| eitanallal | 0:8bb6839e4133 | 41 | } |
| eitanallal | 0:8bb6839e4133 | 42 | return 0; |
| eitanallal | 0:8bb6839e4133 | 43 | } |