555应用

嵌入式系统 时间:2016-11-17来源:网络
C代码:

/*************** 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单片

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW

或用微信扫描左侧二维码

相关文章

查看电脑版