Question: Write a program with the respective Tinkercad circuit design to control traffic lights like the example above. In addition to the example setup, you
Write a program with the respective Tinkercad circuit design to control traffic lights like the example above. In addition to the example setup, you must have a sensor to check for incoming cars before allowing pedestrian crossing. You could use PIR or Ultrasonic distance sensors. An example design would be: No alteration to light sequence if cars are detected. Reset light sequence if there are no cars (resets to 'red for cars' allowing crossing) HINT: PIR sensor detects motion. HINT: Ultrasonic distance sensor measures distance in terms of time.
Step by Step Solution
3.53 Rating (153 Votes )
There are 3 Steps involved in it
cpp const int pirPin 2 PIR sensor input pin const int redCarPin 8 Red light for cars const int yello... View full answer
Get step-by-step solutions from verified subject matter experts
