中级会员
 
- 积分
- 220
- 金钱
- 220
- 注册时间
- 2018-7-27
- 在线时间
- 85 小时
|

楼主 |
发表于 2021-3-21 21:37:58
|
显示全部楼层
[code]while(1)
{
delay_ms(100);
encoder_count=Read_Encoder();
printf("n0.val=%lu\xff\xff\xff",encoder_count );
if(USART_RX_STA&0x8000)
{
len=USART_RX_STA&0x3fff;
USART_RX_STA=0;
//if(!(strcmp(USART_RX_BUF,"1")))
t=strcmp(USART_RX_BUF,"1");
switch(t)
{
case 1:
// Clean_Encoder();
// claen_count=Clean_Encoder();
Count=0;
Enc_Timer_Overflow_one=0;
Current_Count=0;
TIM1->CNT=0;
printf("n0.val=%lu\xff\xff\xff",Count );
break;
}
delay_ms(10);
}
}
}
被引用在主函数这一段 |
|