新闻中心

EEPW首页>嵌入式系统>设计应用> PIC单片机实现流水灯

PIC单片机实现流水灯

作者: 时间:2016-11-30 来源:网络 收藏
#include // 流水灯20091028 22:00

#define uchar unsigned char
#define uint unsigned int
__CONFIG(0x3B31);
void delay(uint x)
{
uint a,b;
for(a=x;a>0;a--)
for(b=110;b>0;b--);
}
void main()
{
uchar i,temp;
TRISA=0x00;
while(1)
{
temp=1;
for(i=0;i<6;i++)
{
PORTA=~temp;//

本文引用地址: //m.amcfsurvey.com/article/201611/323857.htm

temp=temp<<1;//

delay(200);
}
}
}



关键词:PIC单片机流水

评论


技术专区

关闭