标题:
0-99动态数码管显示
[打印本页]
作者:
2429958788
时间:
2018-5-29 09:02
标题:
0-99动态数码管显示
#include<reg51.h>
#define SEG7 P2
unsigned char code DIG_CODE[17]={
0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
0x7f,0x6f};
sbit LSA=P3^0;
sbit LSB=P3^1;
sbit LSC=P3^2;
void Delay8000us(int c) //@12.000MHz
{
unsigned char i, j;
i = 94;
j = 95;
do
{
while (--j);
} while (--i);
}
void main()
{
unsigned char Num;
while(1)
{
for(Num=0;Num<100;Num++)
{
LSA=0;LSB=1;LSC=1;
SEG7=DIG_CODE[Num%100/10];
Delay8000us(1);
LSA=1;LSB=1;LSC=1;
SEG7=DIG_CODE[Num%10];
Delay8000us(1);
}
}
}
作者:
3397987933
时间:
2018-6-2 14:59
能分享下电路图吗?????
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1