Counter + Reset?
Posted: Mon Jul 06, 2020 1:37 am
Train logic problem. One of the 'When' statements need a permanent counter circuit that can take increments and decrements, and the other 'When' statement needs a permanent counter that gets reset upon outputting a value.
Problem: I have an infinite amount of trains in a lane, waiting to be released into the train stop area.
The train stop area has 5 stops (T-5).
When: 1 train is released into the train stop area, a 'counter' is incremented by 1 (++)
When: 1 train arrives at a train stop, when the rail signal for that stop goes from RED (train entered stop) -> GREEN (train fully left stop), now decrement 'counter' by 1 (--)
IF T-5 >= counter THEN the rail signal that releases the trains == GREEN
Is this possible? Examples if so please, trying to learn
Problem: I have an infinite amount of trains in a lane, waiting to be released into the train stop area.
The train stop area has 5 stops (T-5).
When: 1 train is released into the train stop area, a 'counter' is incremented by 1 (++)
When: 1 train arrives at a train stop, when the rail signal for that stop goes from RED (train entered stop) -> GREEN (train fully left stop), now decrement 'counter' by 1 (--)
IF T-5 >= counter THEN the rail signal that releases the trains == GREEN
Is this possible? Examples if so please, trying to learn
