为什么动态显示完后只显示8.
#include"reg51.h"
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code seg[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
uint gsmg_wei[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
void delay(uint i)
{
uchar t;
while(i--)
{
for(t=0;t<120;t++);
}
}
void main(void)
{
uchar i=9;
while(1)
{
P2=gsmg_wei[0];
P0=seg[ i];
i--;
if(i<0)i=0;
delay(500);
}
}
|