简单的方法:
//0 1 2 3 4 5 6 7 8 9 A b C d E F
unsigned char const DispData[]={0x3f,0x6,0x5b,0x4f,0x66,0x6d,0x7d,0x27,0x7f,0x6f,0x77,0x7C,0x58,0x5e,0x79,0x71};
dispBuff[0]=value/4096;
dispBuff[1]=(value%4096)/256;
dispBuff[2]=(value%256)/16;
dispBuff[3]=value%16;
共阳极:0~F
0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E
共阴极:0~F
0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71
不好意思,网络问题发重了
//0 1 2 3 4 5 6 7 8 9 A b C d E F
unsigned char const DispData[]={0x3f,0x6,0x5b,0x4f,0x66,0x6d,0x7d,0x27,0x7f,0x6f,0x77,0x7C,0x58,0x5e,0x79,0x71};
dispBuff[0]=value/4096;
dispBuff[1]=(value%4096)/256;
dispBuff[2]=(value%256)/16;
dispBuff[3]=value%16;
数码管1 = DispData[dispBuff[0]];
数码管2 = DispData[dispBuff[1]];
数码管3 = DispData[dispBuff[2]];
数码管4 = DispData[dispBuff[3]];
一周热门 更多>