cc2530睡眠计时器

 #include "iocc2530.h"
#define LED1 P1_0
#define LED2 P1_1
void led (void){
    P1SEL &=~0X03;
    P1DIR |= 0X03;
}
void yc(int name){
    int i,j;
    for(i=0;i>16);
    ST1 |=(char)(b>>8);
    ST0 |=(char)b;
}
void main(void){
    
    led();
    initst();
    while(1){
      int i;
      for(i=0;i<6;i++){
        LED1 =~LED1;
        yc(2000);
      }
      szsj(3);
      ts_init(2);
      LED2=~LED2;
      yc(2000);
      LED2=~LED2;
      yc(2000);
      LED2=~LED2;
    }
}

你可能感兴趣的:(单片机)