德飞莱STC90C516RD+八位共阴极数码管数字累加
//μ?·éà3£?12êy??1ü£??ù±?ó|ó?£???ê?0-15£??±?ó?′??μ?keil?D?′?é??DD
#include
unsigned char code duanma[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};//0-15
unsigned char code weima[]={0XFE,0XFD,0XFB,0XF7,0XEF,0XDF,0XBF,0X7F};
unsigned char temp[8];
sbit duansuocun = P2^2;
sbit weisuocun = P2^3;
void delay();
main()
{
unsigned char i;//i·??§?a0-2
unsigned int j;
while(1)
{
j++;//j=j+1
for(i=0;i<8;i++)
{
//j++;//j=j+1
temp[0]=duanma[j/10000];
temp[1]=duanma[j/1000%10];
temp[2]=duanma[j/100%10];
temp[3]=duanma[j/10%10];
temp[4]=duanma[j%10];
P0=weima[i];//0111 1111,μúò0
weisuocun=1;//′ò?a?¢??
weisuocun=0;
P0=temp[i];//1111 1110
duansuocun=1;//′ò?a?¢??
duansuocun=0;
delay();
}
}
}
void delay()
{
unsigned int i;
for (i=0;i<600;i++);//′?′|±?D?òa?óòyo?£?£?
}
因篇幅问题不能全部显示,请点此查看更多更全内容