51單片機程序——數碼管全部亮起來
unsigned char code table[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,};// 顯示數值表0-9
void Delay(unsigned int t);
void main (void)
{
unsigned char i;
P1 = 0xff;
while (1)
{
for(i=0;i<10;i++) //加入 for循環,表明for循環大括號中的程序循環執行10次
}
}
void Delay(unsigned int t)
{
}
評論