本文是解决proteus 数码管动态显示问题,具体表现如下:
所使用的代码为:
void display(void)
{
P2=table[temp_shi];
A1=0;A2=1;A3=0;A4=0;
delay(12);
// A1=0;A2=0;A3=0;A4=0;
// delay(1);
P2=table[temp_ge]&0xdf ;//
A1=0;A2=0;A3=1;A4=0;
delay(12);
// A1=0;A2=0;A3=0;A4=0;
// delay(1);
P2=table[temp_po];
A1=0;A2=0;A3=0;A4=1;
delay(12);
// A1=0;A2=0;A3=0;A4=0;
// delay(1);
}
将代码的注释取消即可正常显示。
所用延时函数为:
void delay(uint count) //delay
{
uint i;
while(count)
{
i=200;
while(i>0)
i--;
count--;
}
}