新闻中心

555应用

作者: 时间:2016-11-17 来源:网络 收藏
C代码:

/*************** writer:shopping.w ******************/
#include
#define uint unsigned int
#define uchar unsigned char

本文引用地址:https://www.eepw.com.cn/article/201611/315540.htm

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

评论


技术专区

关闭