8个数码管滚动显示同一个数字
8个数码管显示多个不同的字符
8个数码管闪烁显示
8个数码管滚动显示数字串
#include
__CONFIG(0x3B31);
unsigned char tab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7C,0x39,0x5E,0x79,0x71};//0-F--共阴极数码管
#defineLEDPORTB
void delay1ms(unsigned int x)
{
unsigned char i;
for(;x》0;x--)
for(i=0;i《165;i++);
}
void init()
{
TRISB=0x00;
PORTB=0xFF;
}
void main()
{
unsigned char i;
init();
while(1)
{
for(i=0;i《10;i++)
{
LED=tab[i];
delay1ms(500);
}
}
}