/*************** writer:shopping.w ******************/
#include
#define uint unsigned int
#define uchar unsigned char
sbit Signal = P1^0;
sbit BEEP = P3^7;
void Delay(uint x)
{
uchar i;
while(x--)
{
for(i=0;i<120;i++);
}
}
void main()
{
while(1)
{
if(Signal)
{
BEEP=~BEEP;
Delay(3);
}
}
}
仿真电路:
关键字:555 单片机『本文转载自网络,版权归原作者所有,如有侵权请联系删除』