題目:用定時(shí)器編寫下程序。要求:按下SB按鍵,LED燈點(diǎn)亮,9秒后熄滅,并且在數(shù)碼管上顯示計(jì)時(shí)過(guò)程。
下列是我編的程序,在我用計(jì)算機(jī)調(diào)試程序正確,但仿真軟件不能顯示(仿真軟件沒(méi)有問(wèn)題的)。求幫助,看看那里有錯(cuò)誤幫忙改正,謝謝了
#include"reg51.h"
sbit SB=P0^0;
sbit LED=P2^0;
unsigned char N,t;
void Timer0 ( ) interrupt 1
{TH0=60536/256;
TL0=60536%256;
N++;
if(N>=100)
{t++;N=0;} }
void main( )
{ char i, SEG[ ]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
TMOD=0x01;
TH0=60536/256;
TL0=60536%256;
for(;;)
{while(SB==1)
TR0=1;
ET0=1;
EA=1;
LED=1;
if(t==9);
{LED=1;}
for(t=0;t>=9;t++)
{P1=SEG[ t ] } } }