- #define ROTATE_APAin(2)
- #define ROTATE_BPAin(3)
- s16 DATA=0;
- void EXTI2_IRQHandler(void)
- {
- if(EXTI_GetITStatus(EXTI_Line2) != RESET)
- {
- if(ROTATE_A!=ROTATE_B)
- {
- DATA++;
- }
- elseDATA–;
- EXTI_ClearITPendingBit(EXTI_Line2);
- }
- }
- void main(void)
- {
- SystemInit();
- delay_init(72);
- NVIC_Configuration();
- KEY_Init();
- while(1)
- {
- ;
- }
- }
最精简的stm32编码器程序
#defineROTATE_APAin(2)#defineROTATE_BPAin(3)s16DATA=0;voidEXTI2_IRQHandler(void){if(EXTI_GetITStatus
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/changshang/276029.html