2024-11-12 10:51 AM - last edited on 2024-11-12 02:04 PM by Tesla DeLorean
where I wrote it among the codes.. // Here I have to wait 500ms.
Can you help me to prevent the timers from being affected by this wait?
Can you give me the codes that I will add. Because I am very confused..
I tried many things but they all stopped the interrupts..
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if(htim->Instance==TIM1)
{
if(input1==0)
{
HAL_GPIO_WritePin(GPIOA, GPIO_Pin_1, GPIO_PIN_SET);
// Here I have to wait 500ms.
HAL_GPIO_WritePin(GPIOA, GPIO_Pin_1, GPIO_PIN_RESET);
}
}
Solved! Go to Solution.
2024-11-18 08:20 AM
@XooM wrote:Can you try it on your own board? It definitely doesn't work.
You didn't use the Timercallback correctly. It's your code that doesn't work.
You have the source code. You can see exactly how it works. Watch the video, it has many examples.