//2024.3.6

#define Green 12   //定义绿色灯引脚
#define Yellow 11  //定义黄色灯引脚
#define red 10     //定义绿色灯引脚
void setup() {
  //定义引脚为输出工作模式
  pinMode(Green, OUTPUT);   //绿色灯
  pinMode(Yellow, OUTPUT);  //黄色灯
  pinMode(red, OUTPUT);     //红色灯
}

void loop() {
  digitalWrite(Green, HIGH);  //点亮绿色灯
  digitalWrite(Yellow, LOW);  //熄灭黄色灯
  digitalWrite(red, LOW);     //熄灭红色灯
  delay(200);                 //让绿灯亮200毫秒

  digitalWrite(Green, LOW);   //熄灭绿色灯
  digitalWrite(Yellow, HIGH); //点亮黄色灯
  digitalWrite(red, LOW);     //熄灭红色灯
  delay(200);                 //让黄灯亮200毫秒

  digitalWrite(Green, LOW);   //熄灭绿色灯
  digitalWrite(Yellow, LOW);  //熄灭黄色灯
  digitalWrite(red, HIGH);    //点亮红色灯
  delay(200);                 //让红灯亮200毫秒
}
