CAI_Support
Senior Member
In real life, sometimes there are needs for having ignore certain short pulses, like switch debounce.
For example, if you design a traffic light, you want to have green traffic light for main street most the time, when a car came to the intersection from the smaller street it should trigger traffic light to change. However, sometimes the car from smaller street just stop then made right turn, by the time traffic light changed there was no car waiting any more, so that the traffic light don't really need to change.
If you could use non-blocking delay on the sensor input in the above case, the shorter trigger will be ignored. Simply have a line like:
SET VAR1 IP1[5000]
Any car from smaller street did not stop longer than 5 second will not cause traffic light to change. That will help more cars flowing on the main street.
For example, if you design a traffic light, you want to have green traffic light for main street most the time, when a car came to the intersection from the smaller street it should trigger traffic light to change. However, sometimes the car from smaller street just stop then made right turn, by the time traffic light changed there was no car waiting any more, so that the traffic light don't really need to change.
If you could use non-blocking delay on the sensor input in the above case, the shorter trigger will be ignored. Simply have a line like:
SET VAR1 IP1[5000]
Any car from smaller street did not stop longer than 5 second will not cause traffic light to change. That will help more cars flowing on the main street.