資源簡(jiǎn)介
自己做著好玩的,原來(lái)是用液晶屏做了個(gè)可調(diào)時(shí)鐘,現(xiàn)在想想用數(shù)碼管做個(gè)看看。可仿真,附有源代碼,用普中科技開發(fā)板hc6800-Em3調(diào)試正常。
代碼片段和文件信息
//數(shù)碼管動(dòng)態(tài)顯示
#include
void?delay(int?z);
#define??nage???P2??//P2口作為選擇哪個(gè)數(shù)碼管
#define??shuzi??P0??//P0口位數(shù)碼管顯示什么數(shù)字
char?code?shuzibiao[]={
0x3f0x060x5b0x4f
0x660x6d0x7d0x07
0x7f0x6f0x770x7c
0x390x5e0x790x710x40};
char?code?nagebiao[]={
0xfe0xfd0xfb0xf70xef0xdf0xbf0x7f};
char?code?dian[]={0x000x40}; ?//時(shí)鐘中的小數(shù)點(diǎn)
int?num=0;?
int?k=0;
long?int?temp=0;
int?i;
void?main()
{??
????EA=1;
????TMOD=0x01; //T0為16位重裝方式
????ET0=1; ????//T0中斷允許
????TR0=1; //打開定時(shí)器T1
TH0=(65536-50000)/256; ?//高八位,八位做多256,因此分開裝才能裝下
TL0=(65536-50000)%256; //定時(shí)器裝載初值,12M的晶振機(jī)器周期為1us50000為50ms
while(1)
{???
???int?LedOut[10];
???LedOut[7]=shuzibiao[temp%10];
???????LedOut[6]=shuzibiao[temp%60/10];
???????LedOut[5]=dian[temp%2]; ??
???LedOut[4]=shuzibiao[temp%600/60];
???????LedOut[3]=shuzibiao[temp%3600/600];
???LedOut[2]=dian[temp%2];
???????LedOut[1]=shuzibiao[temp%14400/3600];
???????LedOut[0]=shuzibiao[temp%43200/14400];
?
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????6376??2009-05-07?14:37??數(shù)碼管時(shí)鐘+仿真\STARTUP.A51
?????文件??????14048??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\STARTUP.LST
?????文件????????749??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\STARTUP.OBJ
?????文件?????124689??2012-07-07?14:18??數(shù)碼管時(shí)鐘+仿真\仿真\Last?Loaded?數(shù)碼管時(shí)鐘.DBK
?????文件?????124669??2012-07-07?14:20??數(shù)碼管時(shí)鐘+仿真\仿真\數(shù)碼管時(shí)鐘.DSN
?????文件????????742??2012-07-07?14:20??數(shù)碼管時(shí)鐘+仿真\仿真\數(shù)碼管時(shí)鐘.PWI
?????文件???????7563??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘
?????文件???????1485??2012-07-06?23:46??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘?-?副本.c
?????文件???????4224??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.c
?????文件???????4974??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.hex
?????文件?????????68??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.lnp
?????文件????????729??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.LST
?????文件???????9692??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.M51
?????文件???????9287??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.OBJ
?????文件???????7927??2012-07-07?14:17??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.plg
????.......?????64938??2012-07-07?14:18??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.uvopt
????.......?????13431??2012-07-06?00:14??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘.uvproj
????.......?????64936??2012-07-07?02:40??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘_uvopt.bak
????.......?????????0??2012-07-05?22:36??數(shù)碼管時(shí)鐘+仿真\數(shù)碼管時(shí)鐘_uvproj.bak
?????目錄??????????0??2012-07-07?14:20??數(shù)碼管時(shí)鐘+仿真\仿真
?????目錄??????????0??2012-07-07?14:19??數(shù)碼管時(shí)鐘+仿真
-----------?---------??----------?-----??----
???????????????460527????????????????????21
評(píng)論
共有 條評(píng)論