基于stm32的占空比测量
时间:10-02
整理:3721RD
点击:
void TIM5_IRQHandler(void)
{
TIM_ClearITPendingBit(TIM5, TIM_IT_CC1); //?///??3y?D??±ê????£?
IC2Value = TIM_GetCapture1(TIM5); //? ?
if (IC2Value != 0)
{
DutyCycle = (TIM_GetCapture2(TIM5) * 100) / IC2Value; //?
Frequency = 1000000/IC2Value; //?
}
else
{
Frequency=0;
DutyCycle=0;
}
//TIM_ITConfig(TIM5,TIM_IT_CC2,DISABLE);//?
}
{
TIM_ClearITPendingBit(TIM5, TIM_IT_CC1); //?///??3y?D??±ê????£?
IC2Value = TIM_GetCapture1(TIM5); //? ?
if (IC2Value != 0)
{
DutyCycle = (TIM_GetCapture2(TIM5) * 100) / IC2Value; //?
Frequency = 1000000/IC2Value; //?
}
else
{
Frequency=0;
DutyCycle=0;
}
//TIM_ITConfig(TIM5,TIM_IT_CC2,DISABLE);//?
}
666666666666666
基于51的占空比测量怎么弄