#include "ioCC2530.h" #include "../lib/delay.h" void main( void ) { P0DIR = ( 0x01 << 0 ) | ( 0x01 << 5 ); //P0.0,P0.5 为输出方式 P2DIR |= 0x01; // 设置 P2.0 为输出方式 while( 1 ) { P0_5 = 1; //打开蜂鸣器 P0_0 = 0; P2_0 = 0; delay( 5000 ); P0_5 = 0; //关闭蜂鸣器 P0_0 = 1; P2_0 = 1; delay( 2000 ); } }