新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > 74ls164和51写的简单流水灯

74ls164和51写的简单流水灯

作者: 时间:2016-11-26 来源:网络 收藏
#include

#define uchar unsigned char
#define uint unsigned int
sbit clk=P2^0;
sbit dat=P2^4;

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

void ls164(uchar x)
{
uchar i;
clk=0;
for(i=0;i<8;i++)
{
x=(x>>1);
dat=CY;
clk=1;
clk=0;
}

}

void main()
{
ls164(98);
while(1);

}



关键词: 74ls16451流水

评论


技术专区

关闭