uchar time_max = 99;
uchar time_min = 20;
uchar time_yellow = 5; // 绿灯转红灯时,黄灯的时间
uchar irq_count=0; // 中断计数
uchar time_set[5]={30,30,30,30,20}; // time_set[0]:S-N-Go Time, time_set[1]:S-N-TurnLeft Time,
// time_set[2]:W-E-Go Time, time_set[3]:W-E-TurnLeft Time,
// time_set[4]:Turn-Right Time ,
uchar led_dat[12]={0xFC, 0x60, 0xDA, 0xF2, 0x66, 0xB6, 0xBE, 0xE0, 0xFE, 0xF6, 0x02, 0x00}; // 数码管段码数据
uchar little_set;
uchar time_buffer;
uchar dis_buffer;辣.文'论,文·网
uchar i,y;
/***********************短延时*******************************/
void Sh毕业论文http://www.751com.cn/ ortDelay(void)
{ uchar x,y;
for(x=0;x<5;x++)
for(y=0;y<125;y++)
_Nop();
return;
}
/**********************数码管显示函数*************************/
void display_led(uchar number)
{ uchar buffer[4]={0,0,0,0};
uchar x,y,dat;
if(number<100)
{ buffer[0]=buffer[2]=number/10;
buffer[1]=buffer[3]=number%10;
}
else
{ if(number==100)
buffer[0]=buffer[1]=buffer[2]=buffer[3]=0x0B;
else buffer[0]=buffer[1]=buffer[2]=buffer[3]=0x0A;
}
for(x=0;x<4;x++)
{ dat=led_dat[buffer[x]];
for(y=0;y<8;y++)