数码管不正常显示
时间:10-02
整理:3721RD
点击:
为什么把代码下到单片机上运行先开始数码管有显示,但不正确,最后八个数码管都灭了。请教各位
#include <reg52.h>
typedef unsigned char uchar;
typedef unsigned int uint;
uchar code shumashuzi[ ]={0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8,
0x80, 0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E }; //共阳
uint TH00,TL00;
uchar x=0;
uint b=0;
uchar c=0;
sbit yi=P2^0;
sbit er=P2^1; //38译码器控制
sbit
#include <reg52.h>
typedef unsigned char uchar;
typedef unsigned int uint;
uchar code shumashuzi[ ]={0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8,
0x80, 0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E }; //共阳
uint TH00,TL00;
uchar x=0;
uint b=0;
uchar c=0;
sbit yi=P2^0;
sbit er=P2^1; //38译码器控制
sbit
板子上用的是共阴数码管