Page 326 - MDP2022-2
P. 326
GPIO_PIN_SET){ //GPIOC pin6 == arduino's STM start signal
start = 2; //revers motor start flag
togglePIN=0;
}
if(start==1) {
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_SET);
MOTOR(); //motor start
if(count==50){ //start unset, arduino reset
start=0;
HAL_Delay(5);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_RESET); //send to arduino
"motor is end"
HAL_Delay(600); // ~
delay value is dosen't matter but its essential
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_SET); //send to arduino
"motor is end"
}
}else if(start==2) {
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_SET);
MOTORr(); //revers motor start
if(count==0){ //start unset, arduino reset
start=0;
HAL_Delay(5);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_RESET); //send to arduino
"motor is end"
HAL_Delay(600); // ~
delay value is dosen't matter but its essential
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_SET); //send to arduino
"motor is end"
}
}
//******************************************
}
}
/**
* @brief System Clock Configuration
* @retval None
*/
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};