数码管原理(显示)及编码(段码) 数码管由发光二极管(组合)构成,如下图:
分为:共阳极和共阴极(如上图) 如果显示“0”,共阳极为:abcdefgdp ,dp为对应最高位,a为对应最低位,编码:11000000,16进制0xC0,共阴极正好相反:00111111,16进制0x3f。 以此类推。 共阳极数码管的0 到f的段编码:
0xc0,0xf9,0xa4,0xb0,//0~3
0x99,0x92,0x82,0xf8,//4~7
0x80,0x90,0x88,0x83,//8~b
0xc6,0xa1,0x86,0x8e //c~f 共阴极数码管0到f的短编码:
0x3f,0x06,0x5b,0x4f, //0~3
0x66,0x6d,0x7d,0x07, //4~7
0x7f,0x6f,0x77,0x7c, //8~b
0x39,0x5e,0x79,0x71 //c~f
|