单数码管跳动0到9
#include <reg52.h>
#include <intrins.h>#include "delay.h"
#define SEGPORT P0
unsigned char segdata[16] = {0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E};
void main()
{
unsigned char i;
while(1)
{
for(i = 0; i < 16; i++)
{
SEGPORT = segdata[i];
delay_s(1);
}
}
}