Skip to content

Instantly share code, notes, and snippets.

@cipherwithadot
Created December 8, 2021 06:15
Show Gist options
  • Save cipherwithadot/6cf73eb4131007b05047c2899aa34a2f to your computer and use it in GitHub Desktop.
Save cipherwithadot/6cf73eb4131007b05047c2899aa34a2f to your computer and use it in GitHub Desktop.
Very Simple Traffic Light Simulation With Arduino!
//My Traffic Light Simulation With Arduino
void setup()
{
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void loop()
{
digitalWrite(11, LOW);
digitalWrite(9, HIGH);
delay(2000); // Wait for 2000 millisecond(s)
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
delay(2000); // Wait for 2000 millisecond(s)
digitalWrite(10, LOW);
digitalWrite(11, HIGH);
delay(2000); // Wait for 2000 millisecond(s)
digitalWrite(11, LOW);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment