#include <at89x51.H>
unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; unsigned char Count=0;
unsigned char temp;
void delay1ms(void) { unsigned char k; for(k=0;k<121;k++); } void main(void) { while(1) temp=Count; P0=table[temp%10];P2=0xfe; delay1ms(); P0=table[temp/10];P2=0xfd; delay1ms();
P3=0xff; if(P3==0xfb); { Count++; if(Count==100); { Count=0; } } }
主要功能顯示兩位數(shù)遞加到99,提示一些錯誤也不懂是什么意思 |