So I'm just wondering is it away to do this or not?
I've got a bi-directional forward & backwards DC current can you get the Arduino to work in both ways with-out using a bridge rectifier as it needs to have different colour RGB LED setup.
My first question would be is an Arduino even needed? If the LEDs are onboard the train and indicate the direction of travel, this can probably be done simply, without an Arduino.
So the dip switches set the pattern for each of the two lights at the front of the train: red, purple, white or off. The lights at the rear of the train are both red.When the train reverses, the lights should swap, so that whichever direction the train moves, the red/purple/white lights point in the direction of motion and the red only lights point backwards. Correct so far?Question: for the "route 71" pattern, how can you tell if the train is coming towards or away from you? Both lights would be red in either case.
Ah yes, Sydney trains used to have four lights (red/ white pairs) which identified their current route - but that was some time back. You could no doubt use simple DIP switches and diodes; you have not indicated what control system you are using but it clearly is not DCC - the LEDs will vary in intensity (and colour) with voltage applied.An alternative would be to use an Arduino and WS2812 LEDs.