Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What's wrong with this 5 1 single chip running light code? It's always on and never flashes.
What's wrong with this 5 1 single chip running light code? It's always on and never flashes.
//5 1 MCU running light code, you can refer to this, try it.

# include & ltreg52.h & gt

# Define uchar unsigned characters

# Define uint unsigned integer

Unsigned chattab [] = {0xff, 0xe7, 0xc3, 0x8 1, 0x00, 0x8 1, 0xc3, 0xe7, 0xff, 0x7e, 0x3c, 0x 18, 0x00, 0x/kloc-0. //Change various LED patterns here.

uchar t,I;

void main()

{

TMOD = 0x 10;

th 1 =(65535-50000)/256; ? //Once every 50 milliseconds

TL 1 =(65535-50000)% 256;

EA = 1; ?

et 1 = 1; //Start timer 1 Interrupt

tr 1 = 1; //Start timer 1

t = 0;

I = 0;

while( 1)

{

}

}

Invalid timer 1 () interrupt 3

{

th 1 =(65535-50000)/256; ? //Once every 50 milliseconds

TL 1 =(65535-50000)% 256;

t++;

If (t==20)

{

t = 0;

p 1 = TAB[I];

i++;

if(I = = 16){ I = 0; }

}?

}