#include <reg52.h>
#include <function.h>//详见第六章第8讲
void
main()
{
LED_Init();
EA = 1;
TMOD = 0x01;
TH0=( 65536-( (50000*110592)/120000 ) )/256;
TL0=( 65536-( (50000*110592)/120000 ) )%256;
ET0 = 1;
TR0 = 1;
while
(1);
}
void
TIM0_IRQHandler() interrupt 1
{
static
u8 i;
TH0=( 65536-( (50000*110592)/120000 ) )/256;
TL0=( 65536-( (50000*110592)/120000 ) )%256;
P0=~(0x01<<i);
i++;
if
(i>=8)i=0;
}