Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int redPin = 11;
- int orangePin = 10;
- int greenPin = 9;
- void setup()
- {
- pinMode(redPin, OUTPUT);
- pinMode(orangePin, OUTPUT);
- pinMode(greenPin, OUTPUT);
- }
- void loop()
- {
- // I will open the LED serially
- // 1st "red" will be HIGH for some seconds, then "orange"
- // for a little time and then "green"
- // Step 1
- digitalWrite(redPin, HIGH);
- digitalWrite(orangePin, LOW);
- digitalWrite(greenPin, LOW);
- delay(3000);
- // Step 2
- digitalWrite(redPin, LOW);
- digitalWrite(orangePin, HIGH);
- digitalWrite(greenPin, LOW);
- delay(1000);
- // Step 1
- digitalWrite(redPin, LOW);
- digitalWrite(orangePin, LOW);
- digitalWrite(greenPin, HIGH);
- delay(2000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement