51單片機中斷為什么按一下數字跳10幾下,這個也不好加delay吧
需要如何設置呢
INT0,INT1中斷 ,按一下按鍵跳了10幾下
而且按鍵抬起來也會跳幾下
請解釋一下為什么 謝謝了!!
- //主程序
- void main()
- {
- IE=0x85;
- PX0=1; //中斷優先
- IT0=1;
- IT1=1;
- while(1)
- {
- if(K3==0) Count_A=0;
- if(K4==0) Count_B=0;
- Show_Counts();
- }
- }
- //INT0中斷函數
- void EX_INT0() interrupt 0
- {
- Count_A++;
- }
- //INT1中斷函數
- void EX_INT1() interrupt 2
- {
- Count_B++;
- }
|