vibrate 的意思就是震动
#include "reg52.h"
#include <intrins.h>sbit led1 = P3^7;
sbit vibrate = P3^3;void Delay2000ms() //@11.0592MHz
{unsigned char i, j, k;_nop_();i = 15;j = 2;k = 235;do{do{while (--k);} while (--j);} while (--i);
}void main()
{while(1){if(vibrate == 0)//模块说明告诉我们,震动的话,DO输出低电平{led1 = 0; //亮灯Delay2000ms();led1 = 1;}else{led1 = 1;//灭灯}}
}