I need help writing a program. Yes, I am new to Arduino and at 75 years old it is hard for me to understand the programming. Believe me I have tried but after a week of trying to learn it and reading Arduino for Dummies book, I realize it is something I cannot grasps.
What I am trying do do is:
Auto-reversing model train engine using Arduino Nano and two limit switches.
- Switch one (ST1) start train moving to the right (output 1 high, output 2 low)
- Train starts moving right
- Switch two (LSR2) Limit Switch Right trigger stops train (output 1 high, output 2 high)
- Delay 5 seconds,
- Then (output 1 low, output 2 high) starts train engine moving to the left.
- Switch three (LSL3) Limit Switch Left trigger stops train (output 1 high, output 2 high)
- Delay 5 seconds,
- Then (output 1 high, output 2 low), repeat step two
I will utilize an H-Bridge or two relays (for power reversing) to control the power to the track, due to the amperage required to power the engine.
Thank you for any assistance you can provide.
Brian Krupicka
trains@dbcomserv.com