zigbee技术实现按键控制led中断方式
#include<ioCC2530.h>
#define LED1 P1_0
#define LED2 P1_1
#define LED3 P0_4
#define KEY1 P0_1
#define KEY2 P2_0
void Delay(void);
void main(void){
P0SEL&=~0x12;
P1SEL&=~0x03;
P2SEL&=~0x01;
P0DIR|=0x10;
P1DIR|=0x03;
LED1=0;
LED2=0;
LED3=0;
P0IFG|=0x00;
P0INP|=0x02;
P0IEN|=0x02;
IEN1|=0x20;
PICTL|=0x02;
P2IFG|=0x00;
P2INP|=0x01;
P2IEN|=0x01;
IEN2|=0x02;
PICTL|=0x08;
EA=1;
Delay();
while(1){
LED3=1;
Delay();
LED3=0;
Delay();
}
}
void Delay(void)
{
unsigned int i,j;
for(i=0;i<1000;i++){
for(j=0;j<50;j++){
asm(“