1.数码管介绍
2.数码管原理
3.硬件设计
#include <REGX52.H> typedef unsigned char u8; typedef unsigned int u16; //定义宏,重新定义 P0-P7。数码管8段 #define SMG_DP_PORT P0 //0x3f 0011 1111, u8 gsmg_code[17] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};//共阴极0-F void mian() { SMG_DP_PORT=~0xff;//gsmg_code[0]; while(1) { } }