蜂鸣器发声

#include<reg52.h>
sbit BUZZER=P3^4;
void main(void)
{
   unsigned long int dly=100000;
   BUZZER=1;
   while(dly--);
   BUZZER=0;
   while(1)
   {
   }
}

 

posted @ 2015-03-22 22:36  zhaoyang16  阅读(173)  评论(0编辑  收藏  举报