void VerifObstacleUS() { if(Distance_Obstacle_Av < 10) { while(Distance_Obstacle_Av < 10 ) { Robot_Commande(-100, 0); //Recule } } else if(Distance_Obstacle_Av > 10 && Distance_Obstacle_Av < 15) { Robot_Commande(0, 0); //Stop //Scan Servo_Position(US_AVANT, 0); //Scan tout a gauche Servo_Position(US_AVANT, 48); //Scan millieu Servo_Position(US_AVANT, 60); //Scan tout a droite //Décisions // // } }
void IO_Init(void){ /* configure HSI as System Clock */ SystemCoreClockInit(); SystemCoreClockUpdate(); SysTick_Config(SystemCoreClock / 1000); // SysTick 1 msec interrupts /* Port initializations */ GPIO_Output_Init(GPIOA,Green_LED); //LD2 Initialization Button_Initialize(); //User button init /* Serial Communications Initializations */ SER_Initialize(); USART1_Init(); /* For the GPS */ LPUART_Init(); /* For XBee */ /* ADC Initializations */ ADC_Init(); /* I2C Initialization */ I2C_Init(); /* Mems board Initialization */ ISK01A1_Init(); /* GPS Initialization with 1 second refresh rate */ FGPMMOPA6H_Init(4); /* XBee Initialization */ /* Note that setup takes 2 seconds due to 1 second delays required * By the XBee AT command Sequence */ XBee_900HP_Init(); //Used with long distance 900 MHz XBee // XBee_ProS1_Init(); //Used with 2.4 GHz Xbee /*Position the servo*/ Servo_Position(0); }