I haven't been here for so long and now I was watching Railroad Crossing Malfunctions on Youtube and this got me inspired to build some of those and be making them powered by arduino and this build will be tricky to make as it needs a small hobby motor inside a modified brick that will be the main gates box, I'm gonna work to build a possible model of the U.S ones and go from there.
As for Locomotives - I'm gonna build a few from these companies BNSF, CSX, Northfolk Western, Union Pacific, and Conrail - plus with custom built cars like the tankers and a three wheeled one. - I will be making my own fictional Railroad company that uses one of CSX's Current Locomotives in my own color scheme.
What kind of code I have to use to lower the gates from the arudino as it moves it down as I know it has to be controlled by how much power that is fed to the motor and making two Red Leds flash left to right then turn off when train is done crossing (as I know it can be triggered by a sensor when the train passes and waits about 4-5 seconds before it goes up)