#include <reg52.h>
#define uint unsigned int
#define uchar unsigned char
sbit RED_A = P0^0; //定义管脚
sbit YELLOW_A = P0^1;
sbit GREEN_A = P0^2;
sbit RED_B = P0^3;
sbit YELLOW_B = P0^4;
sbit GREEN_B = P0^5;
uchar Time_Count = 0,Flash_Count = 0,Operation_Type = 1; //count 是计数的意思
void T0_INT() interrupt 1 //定时器T0中断
{
TH0 = -50000/256;
TL0 = -50000%256;
switch(Operation_Type)
{
case 1:
RED_A=0;YELLOW_A=0;GREEN_A=1; //高电平点亮
RED_B=1;YELLOW_B=0;GREEN_B=0;
if(++Time_Count != 100) return; //延时作用
Time_Count=0;
Operation_Type = 2;
break;
case 2:
if(++Time_Count != 8) return;
Time_Count=0;
YELLOW_A=!YELLOW_A;
GREEN_A=0;
if(++Flash_Count != 10) return;
Flash_Co