Difference between revisions of "Traffic Light 1-Way"

From Flowcode Help
Jump to navigationJump to search
Line 15: Line 15:
 
* Create a new flowchart, and select ‘No chip’ as the target device. We choose no chip as this is a simulation only exercise.  
 
* Create a new flowchart, and select ‘No chip’ as the target device. We choose no chip as this is a simulation only exercise.  
 
* Add the ‘Traffic Light 1-Way’ component to the 3D Panel, from the ’Simulation -> Scenarios’ category.  
 
* Add the ‘Traffic Light 1-Way’ component to the 3D Panel, from the ’Simulation -> Scenarios’ category.  
 +
* Adjust the 3D Panel so that you can see the traffic light, The [PresetViews|Preset Views] button or clicking the arrows at the top left of the window can be very helpful.
 
* Add a loop to your program to loop forever until the simulation stop button is pressed.
 
* Add a loop to your program to loop forever until the simulation stop button is pressed.
 
* Use the component macro ‘AutomaticMode’ to start the lights moving through its pre-programmed light patterns.  
 
* Use the component macro ‘AutomaticMode’ to start the lights moving through its pre-programmed light patterns.  

Revision as of 14:07, 20 April 2018

Traffic lights are essential in modern road networks to help control and maintain the flow of traffic.

The lights must be clear to read and follow a regular pattern to allow motorists and other road users to know without any chance of confusion what the lights mean and what will come next in the sequence.

TL1.jpg


Exercise 1

Setup and analyse the light patterns of a traffic light.


Tasks

  • Create a new flowchart, and select ‘No chip’ as the target device. We choose no chip as this is a simulation only exercise.
  • Add the ‘Traffic Light 1-Way’ component to the 3D Panel, from the ’Simulation -> Scenarios’ category.
  • Adjust the 3D Panel so that you can see the traffic light, The [PresetViews|Preset Views] button or clicking the arrows at the top left of the window can be very helpful.
  • Add a loop to your program to loop forever until the simulation stop button is pressed.
  • Use the component macro ‘AutomaticMode’ to start the lights moving through its pre-programmed light patterns.
  • Start the simulation running and count the different states the lights can be in.


Working Example

Below you will see a working example to monitor the light sequence of a simple 1-way traffic light.

FC6 Icon.png Traffic Light 1-Way - Worksheet 1

TL2.jpg