新聞中心

555應(yīng)用

作者: 時間:2016-11-17 來源:網(wǎng)絡(luò) 收藏
C代碼:

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

本文引用地址:http://butianyuan.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);
}
}
}

仿真電路:



關(guān)鍵詞: 555單片

評論


技術(shù)專區(qū)

關(guān)閉