Hi, I hope someone can help me to change a sketch I have for controlling a set of points, and Signal LEDs ...
The sketch I have has most of the Mega pins used for 6 detection Blocks,Signals and IR Sensors and in each block various Points and Signals will change when an Entry sensor is triggered ... the problem I have is all the blocks are in 1 void Loop and if I select Block Detect 1 IR sensor goes LOW points and signals I have setup are triggered and when it Exits block all signals and points go back to normal .... If I know detect Block 2 everything works fine but one of the points which is the point that was used in Block 1 is now LOW so the same point that is in Block 2 goes HIGH and then because the loop is a loop it sees Block 1 (same point) is LOW so turns off ... I want to change the Void Loop to a StateMachine or Switch case but because I have 10 possible Entry sensors I am unsure how to start the sketch for the Switch(case)..
Can anyone help with this
Regards John
There have been numerous videos on how to use Arduinos on a model railroad. I would be happy to help you but I am just not following your description. It sounds like all your block detects are tried together? It sounds like you have some code already written perhaps if you share it I could help and/or a diagram of your layout with the sensor locations marked. You can attach a file to the reply