P0DIR &= ~BIT1;
P0SEL &= ~BIT1;
P2INP |= BIT5;
P0INP &= ~BIT1; //pull up/pull down
P0IEN |= BIT1;
PICTL &= ~BIT0; //bit0 1下降沿触发 /0上升沿
EA = 1;
IEN1 |= 0X20; // P0设置为中断方式;
P0IFG &= ~0x02; //初始化中断标志位
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.