数字显示中要求通过8051单片机驱动一个7段LED数码管。使7段LED数码管在第1

数字显示中要求通过8051单片机驱动一个7段LED数码管。使7段LED数码管在第1秒钟显示“0”,第2秒钟显示“1”,第三秒钟显示“2”,…………第10秒显示“0”,周而复始

第1个回答  2013-01-06
百度自己搜
百度自己搜
百度自己搜
百度自己搜
百度自己搜
百度自己搜
百度自己搜
百度自己搜
百度自己搜
百度自己搜本回答被提问者采纳
第2个回答  2013-01-05
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar i,Second_Counts;
uchar DSY_CODE[]=
{
0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f
};
void DelayMS(uint ms)
{
uchar t;
while(ms--)
{
for(t=0;t<120;t++);
}
}
void main()
{
P0 = 0x3f;
i = 0;
Second_Counts = 0;
TMOD = 0x01;
TH0 = (65535-50000)/256;
TL0 = (65535-50000)%256;
while(1)
{
}
}
void DSY_Refresh() interrupt 1
{
TH0 = (65535-50000)/256;
TL0 = (65535-50000)%256;
if(++i==20)
{
i = 0;
P0 = DSY_CODE[Second_Counts++];
if(Second_Counts == 10) Second_Counts = 0;
}
}
第3个回答  2013-01-05
这相当于一个秒表了吧??这不难呀。我这里有一些资料,需要可以来找我,在线,等待回复。
第4个回答  2013-01-05
怎么给你呢,数码管共阴还是共阳啊追问

共阴发到我的邮箱339864521@qq.com谢谢

追答

前面你都满意回答了,我还是不发了吧,那你都满意就自己搜去吧

相似回答