?? 1.c
字號:
#include"at89x51.h"
void ms(unsigned int Delay)
{
unsigned int a;
for(;Delay>0;Delay--)
{
for(a=0;a<114;a++){;}
}
}
void main(void)
{
unsigned char a;
unsigned char shu[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
P2=0;
P3=255;
while(1)
{
P2=a;
ms(300);
while(1)
{
P0_3=0;
P1=shu[a/200];
ms(1);
P0_3=1;
P0_2=0;
P1=shu[a/20%10]-128;
ms(1);
P0_2=1;
P0_1=0;
P1=shu[a/2%10];
ms(1);
P0_1=1;
P0_0=0;
P1=0xc1;
ms(1);
P0_0=1;
if(!P3_2||!P3_0||!P3_3) break;
}
if(!P3_3)
{
if(a>20) a-=20;
else a=0;
}
if(!P3_0)
{
if(a<=220) a+=20;
else a=240;
}
if(!P3_2&&a<=238) a+=2;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -