51单片机接74ls164驱动数码管的C程序,实现控制数码管0到9循环显示

可以发到我邮箱:yangmaojuwuhua@163.com..非常感谢
2025-01-05 09:22:49
推荐回答(1个)
回答(1):

#include
code table[16]=
{
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71
};
unsigned char date;
void delayms(unsigned int cc)
{
unsigned int x,y;
for(y=cc;y>0;y--)
for(x=500;x>0;x--);
}
void main()
{
while(1)
{
for(date=0;date<10;date++)
{
SBUF=table[date];
while(!TI);
TI=0;
delayms(1000);
}
}
}