在proteus里使用 7SEG MPX4 CC 显示正常 但是我没有这个。。 只有4个共阴极LED数码管
但是改了之后显示不正常 是什么原因呢? 求大神指教
程序如下:uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x89,0x86 }; //0,1,2,3,4,5,6,7,8,9,h,e
void xian(int timer) { a=timer/1000; //千位 b=(timer%1000)/100;//百位 c=(timer%1000)%100/10;//十位 d=timer%10; //个位 P2=0Xfe; P0=table[a]; delay(5); P2=0XFF; P2=0Xfd; P0=table[ b]; delay(5); P2=0XFF; P2=0Xfb; P0=table[c]; delay(5); P2=0XFF; P2=0Xf7; P0=table[d]; delay(5); } |