Component: Pedestrian Crossing (Scenarios)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category Scenarios


Image Pedestrian Crossing component

A set of pedestrian crossing lights complete with manual light control, a simple state machine and an automatic mode to allow the lights to take care of themselves.

Examples

There is a detailed walk through of the scenario detailed at the link below to go with this component.

Pedestrian Crossing Scenario

Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

GetStopGo

Reads one of the light sets to determine if it is safe to go through the lights.

Returns 1 for a Green light, otherwise returns 0.

Parameters

This macro has no parameters


Return value

BOOL : Returns true if the operation is a success, else false


ReadSwitch

Check to see if switch is currently pressed.

Return: 0 = Not Pressed, 1 = Pressed

Parameters

This macro has no parameters


Return value

BOOL : Returns true if the operation is a success, else false


AutomaticMode

Enables or Disables automatic mode where the lights will automatically cycle between modes.

Parameters

BOOL Mode
0 = Auto Mode Disabled, 1 = Auto Mode Enabled


Return value

This call does not return a value


GetLightState

Reads the state of one of the light sets.

Returns the state as a number.

0=Red, 1=Red+Wait, 2=Green, 3=FlashingGreen, 4=Unknown State

Parameters

This macro has no parameters


Return value

BYTE


SetLights

Direct control over all 3 of the lights.

Parameters

BOOL Red
0 = Off, 1 = On
BOOL Green
0 = Off, 1 = On
BOOL Wait
0 = Off, 1 = On


Return value

This call does not return a value


SetLightState

Follows the standard pedestrian crossing light sequence.

Parameters

BYTE SequenceNumber
0 = Red, 1 = Red+Wait, 2 = Green, 3 = Green Flashing


Return value

This call does not return a value



Property reference

Red Colour

This property is of type Color picker and can be referenced with the variable name Red.

Colour Picker to set the Colour of the Red indicator.


Green Colour

This property is of type Color picker and can be referenced with the variable name Green.

Colour Picker to set the Colour of the Green indicator.


Wait Colour

This property is of type Color picker and can be referenced with the variable name Wait.

Colour Picker to set the Colour of the Wait indicator.


Off Colour

This property is of type Color picker and can be referenced with the variable name Off.

Colour Picker to set the Colour of all indicators when they are switched off.


Wait Time

This property is of type Unsigned integer and can be referenced with the variable name WaitTime.

Amount of time to wait in milliseconds the pedestrians have to wait before being allowed to cross.


Crossing Time

This property is of type Unsigned integer and can be referenced with the variable name CrossTime.

Amount of time to wait in milliseconds for the pedestrians to cross the road.


Flash Time

This property is of type Unsigned integer and can be referenced with the variable name FlashTime.

Amount of time to wait in milliseconds to warn pedestrians to finish crossing the road.


Switch

This property is of type Single digital pin and can be referenced with the variable name Switch.

Pin connection assigned to the pedestrian waiting to cross switch.