preparation a l'agregation externe SI option II
Dependencies: BSP_DISCO_F746NG
Revision 7:f048ec10c1ca, committed 2022-06-02
- Comitter:
- ajuton
- Date:
- Thu Jun 02 06:08:08 2022 +0000
- Parent:
- 6:be846d0b354a
- Commit message:
- Programme de base du TP de preparation a l'epreuve 5 de l'agregation externe de SI option II
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r be846d0b354a -r f048ec10c1ca main.cpp --- a/main.cpp Fri Feb 12 08:35:58 2021 +0000 +++ b/main.cpp Thu Jun 02 06:08:08 2022 +0000 @@ -4,22 +4,20 @@ #include "string.h" CAN canbus(PB_8, PB_9); +DigitalIn bp1(PG_6); DigitalOut led1(PI_1); DigitalOut led2(PB_14); + int main() { TS_StateTypeDef TS_State; uint16_t x, y; - uint8_t status; uint8_t idx; - uint8_t cleared = 0; uint32_t i=0,id,id_old,line=20; uint8_t data[8]; - uint32_t vitesse_vehicule = 50; - uint32_t regime_moteur = 2000; CANMessage msg; - char text[50]="Prepa Agreg Interne"; + char text[50]="Prepa Agreg Externe Epreuve 5"; char text2[10]; canbus.frequency(125000); BSP_LCD_Init(); @@ -30,14 +28,8 @@ BSP_LCD_SetBackColor(LCD_COLOR_GREEN); BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE); BSP_LCD_DisplayStringAt(0, 2, (uint8_t *)text, CENTER_MODE); - status = BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize()); + BSP_TS_Init(BSP_LCD_GetXSize(), BSP_LCD_GetYSize()); - //initialisation de la dalle tactile - if (status != TS_OK) { - BSP_LCD_DisplayStringAt(0, 260, (uint8_t *)"TOUCHSCREEN INIT FAIL", CENTER_MODE); - } else { - BSP_LCD_DisplayStringAt(0, 260, (uint8_t *)"TOUCHSCREEN INIT OK", CENTER_MODE); - } BSP_LCD_SetTextColor(LCD_COLOR_WHITE); BSP_LCD_SetBackColor(LCD_COLOR_DARKBLUE); @@ -58,7 +50,9 @@ BSP_LCD_DisplayStringAt(0, line, (uint8_t *)text, LEFT_MODE); id_old= id; } - //detection d'un appui sur la dalle tactile + + led2.write(bp1.read()); + BSP_TS_GetState(&TS_State); if (TS_State.touchDetected) { x = TS_State.touchX[0];