//Global variable
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(2, OUTPUT);
}
void loop() {
// red
digitalWrite(13, HIGH);
Serial.println("RED ON");
delay(50); // this speeds up the simulation
digitalWrite(13, LOW);
delay(50);
// yellow
digitalWrite(12, HIGH);
Serial.println("YELLOW ON");
delay(50); // this speeds up the simulation
digitalWrite(12, LOW);
delay(50);
// green
digitalWrite(2, HIGH);
Serial.println("GREEN ON");
delay(50); // this speeds up the simulation
digitalWrite(2, LOW);
delay(50);
}