SlideShare a Scribd company logo
ARDUINO TRAFFIC LIGHTS
ARDUINO UNO
int red = 11; int yellow = 12; int green = 13;
• void setup(){
• pinMode(red,OUTPUT);
• pinMode(yellow,OUTPUT);
pinMode(green,OUTPUT); }
• int red = 13; int yellow = 12; int green =
11;
• void setup(){
pinMode(red,OUTPUT);
pinMode(yellow,OUTPUT);
pinMode(green,OUTPUT); }
• void loop(){
• changeLights(); delay(15000); }
• void changeLights(){
• // green off, yellow for 3 seconds digitalWrite(green,HIGH);
• digitalWrite(yellow,LOW);
• delay(3000);
• // turn off yellow, then turn red on for 5 seconds
• digitalWrite(yellow,LOW);
digitalWrite(red,HIGH);
delay(5000);
// red and yellow on for 2 seconds (red is already on though)
digitalWrite(yellow,HIGH); delay(2000); // turn off red and yellow,
then turn on green digitalWrite(yellow,LOW); digitalWrite(red,LOW);
digitalWrite(green,HIGH); }
• void changeLights(){
• // green off, yellow for 3 seconds
digitalWrite(green,HIGH);
digitalWrite(yellow,LOW); delay(3000);
•
•
•
•
•

// turn off yellow, then turn red on for 5 seconds
digitalWrite(yellow,LOW); digitalWrite(red,HIGH);
delay(5000);
// turn off red and yellow, then turn on green
digitalWrite(yellow,LOW); digitalWrite(red,LOW);
digitalWrite(green,HIGH); }
ARDUINO SOFTWARE
Download
Execute
Recognize Arduino (1)
Update the controllers
BLINK CODE
BLINK CODE
Arduino can speak with Processing

More Related Content

What's hot

Traffic light controller
Traffic light controllerTraffic light controller
Traffic light controller
Rkrishna Mishra
 
Ppt on automatic street light control using ir sensors
Ppt on automatic street light control using ir sensorsPpt on automatic street light control using ir sensors
Ppt on automatic street light control using ir sensors
Vikram Emmidi
 
Women safety device with gps tracking and alerts
Women safety device with gps tracking  and alertsWomen safety device with gps tracking  and alerts
Women safety device with gps tracking and alerts
Praween Lakra
 
Traffic light controller
Traffic light controllerTraffic light controller
Traffic light controller
nimmi_abes
 
Electronic voting machine
Electronic voting    machineElectronic voting    machine
Electronic voting machine
mani akuthota
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
xavierpaulino
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Arduino- Serial communication
Arduino-  Serial communicationArduino-  Serial communication
Arduino- Serial communication
Jawaher Abdulwahab Fadhil
 
Target hardware debugging
Target hardware debuggingTarget hardware debugging
Target hardware debugging
Shriya Shankar
 
Choppers
ChoppersChoppers
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind Stick
Gagandeep Singh
 
Ardui no
Ardui no Ardui no
Ardui no
Amol Sakhalkar
 
Smart blind
Smart blindSmart blind
Smart blind
Raja
 
Arduino Uno Pin Description
Arduino Uno Pin DescriptionArduino Uno Pin Description
Arduino Uno Pin Description
Niket Chandrawanshi
 
Automated Plant Watering System
Automated Plant Watering SystemAutomated Plant Watering System
Automated Plant Watering System
Soumyadeep Kal
 
Bidirectional visitor counter
Bidirectional visitor counterBidirectional visitor counter
Bidirectional visitor counter
Zakir Gulzar
 
Clap On Clap Off Switch
Clap On Clap Off SwitchClap On Clap Off Switch
Clap On Clap Off Switch
fariharowshan
 
Automatic room light controller with bidirectional visitor counter
Automatic room light controller with bidirectional visitor counterAutomatic room light controller with bidirectional visitor counter
Automatic room light controller with bidirectional visitor counter
BIRLA VISHVAKARMA MAHAVIDYALAY
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
Ravi Phadtare
 
traffic light control using 4017 ic counter & timer 555
traffic light control using 4017 ic counter & timer 555traffic light control using 4017 ic counter & timer 555
traffic light control using 4017 ic counter & timer 555
Naveen Rao
 

What's hot (20)

Traffic light controller
Traffic light controllerTraffic light controller
Traffic light controller
 
Ppt on automatic street light control using ir sensors
Ppt on automatic street light control using ir sensorsPpt on automatic street light control using ir sensors
Ppt on automatic street light control using ir sensors
 
Women safety device with gps tracking and alerts
Women safety device with gps tracking  and alertsWomen safety device with gps tracking  and alerts
Women safety device with gps tracking and alerts
 
Traffic light controller
Traffic light controllerTraffic light controller
Traffic light controller
 
Electronic voting machine
Electronic voting    machineElectronic voting    machine
Electronic voting machine
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Arduino- Serial communication
Arduino-  Serial communicationArduino-  Serial communication
Arduino- Serial communication
 
Target hardware debugging
Target hardware debuggingTarget hardware debugging
Target hardware debugging
 
Choppers
ChoppersChoppers
Choppers
 
Sensor Based Blind Stick
Sensor Based Blind StickSensor Based Blind Stick
Sensor Based Blind Stick
 
Ardui no
Ardui no Ardui no
Ardui no
 
Smart blind
Smart blindSmart blind
Smart blind
 
Arduino Uno Pin Description
Arduino Uno Pin DescriptionArduino Uno Pin Description
Arduino Uno Pin Description
 
Automated Plant Watering System
Automated Plant Watering SystemAutomated Plant Watering System
Automated Plant Watering System
 
Bidirectional visitor counter
Bidirectional visitor counterBidirectional visitor counter
Bidirectional visitor counter
 
Clap On Clap Off Switch
Clap On Clap Off SwitchClap On Clap Off Switch
Clap On Clap Off Switch
 
Automatic room light controller with bidirectional visitor counter
Automatic room light controller with bidirectional visitor counterAutomatic room light controller with bidirectional visitor counter
Automatic room light controller with bidirectional visitor counter
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
 
traffic light control using 4017 ic counter & timer 555
traffic light control using 4017 ic counter & timer 555traffic light control using 4017 ic counter & timer 555
traffic light control using 4017 ic counter & timer 555
 

Similar to Arduino traffic lights

Arduino based applications part 1
Arduino based applications part 1Arduino based applications part 1
Arduino based applications part 1
Jawaher Abdulwahab Fadhil
 
[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노
Chiwon Song
 
Up and running with Teensy 3.1
Up and running with Teensy 3.1Up and running with Teensy 3.1
Up and running with Teensy 3.1
yoonghm
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RAD
lostcaggy
 
Introduction to arduino Programming with
Introduction to arduino Programming withIntroduction to arduino Programming with
Introduction to arduino Programming with
likhithkumpala159
 
Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31
Shigeru Kobayashi
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacing
COMSATS Abbottabad
 
Mims effect
Mims effectMims effect
Mims effect
arnaullb
 
Feedback ud6.
Feedback ud6. Feedback ud6.
Feedback ud6.
ngelaNezPrez
 
Magnetic door lock using arduino
Magnetic door lock using arduinoMagnetic door lock using arduino
Magnetic door lock using arduino
Sravanthi Sinha
 
Scoala de vara_idg_introducere_in_robotica
Scoala de vara_idg_introducere_in_roboticaScoala de vara_idg_introducere_in_robotica
Scoala de vara_idg_introducere_in_robotica
ScoalaVara
 
Transducer using PCB (Sound-to-light Conversion and Loudness Representation u...
Transducer using PCB (Sound-to-light Conversion and Loudness Representation u...Transducer using PCB (Sound-to-light Conversion and Loudness Representation u...
Transducer using PCB (Sound-to-light Conversion and Loudness Representation u...
Emran Ahmed
 
Metal detecting robot sketch
Metal detecting robot sketchMetal detecting robot sketch
Metal detecting robot sketch
Akhil Unnikrishnan
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
Jeni Shah
 

Similar to Arduino traffic lights (14)

Arduino based applications part 1
Arduino based applications part 1Arduino based applications part 1
Arduino based applications part 1
 
[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노[가상편] 하드웨어에 생명을 주는 아두이노
[가상편] 하드웨어에 생명을 주는 아두이노
 
Up and running with Teensy 3.1
Up and running with Teensy 3.1Up and running with Teensy 3.1
Up and running with Teensy 3.1
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RAD
 
Introduction to arduino Programming with
Introduction to arduino Programming withIntroduction to arduino Programming with
Introduction to arduino Programming with
 
Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacing
 
Mims effect
Mims effectMims effect
Mims effect
 
Feedback ud6.
Feedback ud6. Feedback ud6.
Feedback ud6.
 
Magnetic door lock using arduino
Magnetic door lock using arduinoMagnetic door lock using arduino
Magnetic door lock using arduino
 
Scoala de vara_idg_introducere_in_robotica
Scoala de vara_idg_introducere_in_roboticaScoala de vara_idg_introducere_in_robotica
Scoala de vara_idg_introducere_in_robotica
 
Transducer using PCB (Sound-to-light Conversion and Loudness Representation u...
Transducer using PCB (Sound-to-light Conversion and Loudness Representation u...Transducer using PCB (Sound-to-light Conversion and Loudness Representation u...
Transducer using PCB (Sound-to-light Conversion and Loudness Representation u...
 
Metal detecting robot sketch
Metal detecting robot sketchMetal detecting robot sketch
Metal detecting robot sketch
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
 

Recently uploaded

Part 2 Deep Dive: Navigating the 2024 Slowdown
Part 2 Deep Dive: Navigating the 2024 SlowdownPart 2 Deep Dive: Navigating the 2024 Slowdown
Part 2 Deep Dive: Navigating the 2024 Slowdown
jeffkluth1
 
Kirill Klip GEM Royalty TNR Gold Copper Presentation
Kirill Klip GEM Royalty TNR Gold Copper PresentationKirill Klip GEM Royalty TNR Gold Copper Presentation
Kirill Klip GEM Royalty TNR Gold Copper Presentation
Kirill Klip
 
The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...
The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...
The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...
APCO
 
一比一原版新西兰奥塔哥大学毕业证(otago毕业证)如何办理
一比一原版新西兰奥塔哥大学毕业证(otago毕业证)如何办理一比一原版新西兰奥塔哥大学毕业证(otago毕业证)如何办理
一比一原版新西兰奥塔哥大学毕业证(otago毕业证)如何办理
taqyea
 
2024-6-01-IMPACTSilver-Corp-Presentation.pdf
2024-6-01-IMPACTSilver-Corp-Presentation.pdf2024-6-01-IMPACTSilver-Corp-Presentation.pdf
2024-6-01-IMPACTSilver-Corp-Presentation.pdf
hartfordclub1
 
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
concepsionchomo153
 
Call8328958814 satta matka Kalyan result satta guessing
Call8328958814 satta matka Kalyan result satta guessingCall8328958814 satta matka Kalyan result satta guessing
Call8328958814 satta matka Kalyan result satta guessing
➑➌➋➑➒➎➑➑➊➍
 
Digital Transformation Frameworks: Driving Digital Excellence
Digital Transformation Frameworks: Driving Digital ExcellenceDigital Transformation Frameworks: Driving Digital Excellence
Digital Transformation Frameworks: Driving Digital Excellence
Operational Excellence Consulting
 
The Most Inspiring Entrepreneurs to Follow in 2024.pdf
The Most Inspiring Entrepreneurs to Follow in 2024.pdfThe Most Inspiring Entrepreneurs to Follow in 2024.pdf
The Most Inspiring Entrepreneurs to Follow in 2024.pdf
thesiliconleaders
 
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
taqyea
 
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian MatkaDpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
dpbossdpboss69
 
Profiles of Iconic Fashion Personalities.pdf
Profiles of Iconic Fashion Personalities.pdfProfiles of Iconic Fashion Personalities.pdf
Profiles of Iconic Fashion Personalities.pdf
TTop Threads
 
The Steadfast and Reliable Bull: Taurus Zodiac Sign
The Steadfast and Reliable Bull: Taurus Zodiac SignThe Steadfast and Reliable Bull: Taurus Zodiac Sign
The Steadfast and Reliable Bull: Taurus Zodiac Sign
my Pandit
 
IMG_20240615_091110.pdf dpboss guessing
IMG_20240615_091110.pdf dpboss  guessingIMG_20240615_091110.pdf dpboss  guessing
AI Transformation Playbook: Thinking AI-First for Your Business
AI Transformation Playbook: Thinking AI-First for Your BusinessAI Transformation Playbook: Thinking AI-First for Your Business
AI Transformation Playbook: Thinking AI-First for Your Business
Arijit Dutta
 
DearbornMusic-KatherineJasperFullSailUni
DearbornMusic-KatherineJasperFullSailUniDearbornMusic-KatherineJasperFullSailUni
DearbornMusic-KatherineJasperFullSailUni
katiejasper96
 
Lundin Gold Corporate Presentation - June 2024
Lundin Gold Corporate Presentation - June 2024Lundin Gold Corporate Presentation - June 2024
Lundin Gold Corporate Presentation - June 2024
Adnet Communications
 
Ellen Burstyn: From Detroit Dreamer to Hollywood Legend | CIO Women Magazine
Ellen Burstyn: From Detroit Dreamer to Hollywood Legend | CIO Women MagazineEllen Burstyn: From Detroit Dreamer to Hollywood Legend | CIO Women Magazine
Ellen Burstyn: From Detroit Dreamer to Hollywood Legend | CIO Women Magazine
CIOWomenMagazine
 
2022 Vintage Roman Numerals Men Rings
2022 Vintage Roman  Numerals  Men  Rings2022 Vintage Roman  Numerals  Men  Rings
2022 Vintage Roman Numerals Men Rings
aragme
 
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 

Recently uploaded (20)

Part 2 Deep Dive: Navigating the 2024 Slowdown
Part 2 Deep Dive: Navigating the 2024 SlowdownPart 2 Deep Dive: Navigating the 2024 Slowdown
Part 2 Deep Dive: Navigating the 2024 Slowdown
 
Kirill Klip GEM Royalty TNR Gold Copper Presentation
Kirill Klip GEM Royalty TNR Gold Copper PresentationKirill Klip GEM Royalty TNR Gold Copper Presentation
Kirill Klip GEM Royalty TNR Gold Copper Presentation
 
The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...
The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...
The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...
 
一比一原版新西兰奥塔哥大学毕业证(otago毕业证)如何办理
一比一原版新西兰奥塔哥大学毕业证(otago毕业证)如何办理一比一原版新西兰奥塔哥大学毕业证(otago毕业证)如何办理
一比一原版新西兰奥塔哥大学毕业证(otago毕业证)如何办理
 
2024-6-01-IMPACTSilver-Corp-Presentation.pdf
2024-6-01-IMPACTSilver-Corp-Presentation.pdf2024-6-01-IMPACTSilver-Corp-Presentation.pdf
2024-6-01-IMPACTSilver-Corp-Presentation.pdf
 
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
 
Call8328958814 satta matka Kalyan result satta guessing
Call8328958814 satta matka Kalyan result satta guessingCall8328958814 satta matka Kalyan result satta guessing
Call8328958814 satta matka Kalyan result satta guessing
 
Digital Transformation Frameworks: Driving Digital Excellence
Digital Transformation Frameworks: Driving Digital ExcellenceDigital Transformation Frameworks: Driving Digital Excellence
Digital Transformation Frameworks: Driving Digital Excellence
 
The Most Inspiring Entrepreneurs to Follow in 2024.pdf
The Most Inspiring Entrepreneurs to Follow in 2024.pdfThe Most Inspiring Entrepreneurs to Follow in 2024.pdf
The Most Inspiring Entrepreneurs to Follow in 2024.pdf
 
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
 
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian MatkaDpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
 
Profiles of Iconic Fashion Personalities.pdf
Profiles of Iconic Fashion Personalities.pdfProfiles of Iconic Fashion Personalities.pdf
Profiles of Iconic Fashion Personalities.pdf
 
The Steadfast and Reliable Bull: Taurus Zodiac Sign
The Steadfast and Reliable Bull: Taurus Zodiac SignThe Steadfast and Reliable Bull: Taurus Zodiac Sign
The Steadfast and Reliable Bull: Taurus Zodiac Sign
 
IMG_20240615_091110.pdf dpboss guessing
IMG_20240615_091110.pdf dpboss  guessingIMG_20240615_091110.pdf dpboss  guessing
IMG_20240615_091110.pdf dpboss guessing
 
AI Transformation Playbook: Thinking AI-First for Your Business
AI Transformation Playbook: Thinking AI-First for Your BusinessAI Transformation Playbook: Thinking AI-First for Your Business
AI Transformation Playbook: Thinking AI-First for Your Business
 
DearbornMusic-KatherineJasperFullSailUni
DearbornMusic-KatherineJasperFullSailUniDearbornMusic-KatherineJasperFullSailUni
DearbornMusic-KatherineJasperFullSailUni
 
Lundin Gold Corporate Presentation - June 2024
Lundin Gold Corporate Presentation - June 2024Lundin Gold Corporate Presentation - June 2024
Lundin Gold Corporate Presentation - June 2024
 
Ellen Burstyn: From Detroit Dreamer to Hollywood Legend | CIO Women Magazine
Ellen Burstyn: From Detroit Dreamer to Hollywood Legend | CIO Women MagazineEllen Burstyn: From Detroit Dreamer to Hollywood Legend | CIO Women Magazine
Ellen Burstyn: From Detroit Dreamer to Hollywood Legend | CIO Women Magazine
 
2022 Vintage Roman Numerals Men Rings
2022 Vintage Roman  Numerals  Men  Rings2022 Vintage Roman  Numerals  Men  Rings
2022 Vintage Roman Numerals Men Rings
 
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
 

Arduino traffic lights

  • 3.
  • 4.
  • 5. int red = 11; int yellow = 12; int green = 13;
  • 6. • void setup(){ • pinMode(red,OUTPUT); • pinMode(yellow,OUTPUT); pinMode(green,OUTPUT); }
  • 7.
  • 8. • int red = 13; int yellow = 12; int green = 11; • void setup(){ pinMode(red,OUTPUT); pinMode(yellow,OUTPUT); pinMode(green,OUTPUT); }
  • 9. • void loop(){ • changeLights(); delay(15000); } • void changeLights(){ • // green off, yellow for 3 seconds digitalWrite(green,HIGH); • digitalWrite(yellow,LOW); • delay(3000); • // turn off yellow, then turn red on for 5 seconds • digitalWrite(yellow,LOW); digitalWrite(red,HIGH); delay(5000); // red and yellow on for 2 seconds (red is already on though) digitalWrite(yellow,HIGH); delay(2000); // turn off red and yellow, then turn on green digitalWrite(yellow,LOW); digitalWrite(red,LOW); digitalWrite(green,HIGH); }
  • 10. • void changeLights(){ • // green off, yellow for 3 seconds digitalWrite(green,HIGH); digitalWrite(yellow,LOW); delay(3000);
  • 11. • • • • • // turn off yellow, then turn red on for 5 seconds digitalWrite(yellow,LOW); digitalWrite(red,HIGH); delay(5000); // turn off red and yellow, then turn on green digitalWrite(yellow,LOW); digitalWrite(red,LOW); digitalWrite(green,HIGH); }
  • 15.
  • 20. Arduino can speak with Processing