嵌入式处理器Word文档格式.docx
《嵌入式处理器Word文档格式.docx》由会员分享,可在线阅读,更多相关《嵌入式处理器Word文档格式.docx(11页珍藏版)》请在冰豆网上搜索。
for(k=0;
k<
k++);
}
intmain(void)
inti;
LED_CS2=0x4040;
//00
LED_CS3=0x4040;
for(i=1;
i<
100;
i++)
{
intb=0,c=0;
inta=0x0000;
c=i/10;
b=i-10*c;
if(b==1)
a+=0x7900;
elseif(b==2)
a+=0x2400;
elseif(b==3)
a+=0x3000;
elseif(b==4)
a+=0x1900;
elseif(b==5)
a+=0x1200;
elseif(b==6)
a+=0x0200;
elseif(b==7)
a+=0x7800;
elseif(b==8)
a+=0x0000;
elseif(b==9)
a+=0x1000;
elseif(b==0)
a+=0x4000;
if(c==1)
a+=0x0079;
elseif(c==2)
a+=0x0024;
if(c==3)
a+=0x0030;
if(c==4)
a+=0x0019;
if(c==5)
a+=0x0012;
if(c==6)
a+=0x0002;
if(c==7)
a+=0x0078;
if(c==8)
a+=0x0000;
if(c==9)
a+=0x0010;
if(c==0)
a+=0x0040;
LED_CS3=a;
Delay(300);
}
/*LED_CS2=0x2479;
//12
LED_CS3=0x1930;
//34
while
(1)
{
Delay(300);
LED_CS2=0x3024;
//23
LED_CS3=0x1219;
//45
LED_CS2=0x1930;
LED_CS3=0x0212;
//56
LED_CS2=0x1219;
//45
LED_CS3=0x7802;
//67
LED_CS2=0x0212;
//56
LED_CS3=0x0078;
//78
LED_CS2=0x7802;
LED_CS3=0x1000;
//89
LED_CS2=0x0078;
LED_CS3=0x8f10;
//90
LED_CS2=0x1000;
LED_CS3=0x8f8f;
//00
LED_CS2=0x8f10;
LED_CS2=0x8f8f;
LED_CS2=0x2479;
LED_CS3=0x1930;
}*/
return0;
{unsignedshortintnum,gw,sw,gwcode,swcode,display:
LED_CS2=0x8f8f;
LED_CS3=0x8f8f;
for(num=1;
num<
num++)
sw=num/10;
gw=num%10;
switch(sw)
case0:
swcode=0x40;
break;
case1:
swcode=0x79;
case2:
swcode=0x24;
case3:
swcode=0x30;
case4:
swcode=0x19;
case5:
swcode=0x12;
case6:
swcode=0x02;
case7:
swcode=0x78;
case8:
swcode=0x00;
case9:
swcode=0x10;
switch(gw)
gwcode=0x40;
gwcode=0x79;
gwcode=0x24;
gwcode=0x30;
gwcode=0x19;
gwcode=0x12;
gwcode=0x02;
gwcode=0x78;
gwcode=0x00;
gwcode=0x10;
display=swcode<
<
8|gwcode;
LED_CS3=display;
Delay(100);
Delay(100);