AT89C51单片机数码管闪烁问题怎么解决0
LJbobo2018.05.04浏览32次分享举报
#include#defineu8unsignedchar#defineu16unsignedintsbitdula=P2^6;//段选信号的锁存器控制sbitwela=P2^7;//位选信号的锁存器控制u8codewei[]={0x7f,0xbf,0xdf,0xef,0xf7,0... #include
#define u8 unsigned char
#define u16 unsigned int
sbit dula=P2^6;//段选信号的锁存器控制
sbit wela=P2^7;//位选信号的锁存器控制
u8 code wei[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};//数码管各位的码表
u8 code duan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x00};//0-f的码表
u8 dis_shu[8]={0};
bit dis_flag=0;
u8 lcd_state=0;
u8 dis_time_count=0;
//******数码管显示函数***********//
void display(long num)
{
long i,weishu;
for(weishu=0,i