Re: Servos, Ardunios, and JMRI #arduino

Bob Jacobsen

Could you post your scripts so we can see the details?

I suspect they’re defining objects with the same names.


On Jul 23, 2019, at 2:58 PM, Sam Simons <samusi01@...> wrote:

I've been working on getting my staging turnouts powered by servos and controlled by JMRI through Arduinos using Geoff Bunza's direct JMRI to Arduino scripts. The ends of the staging yards are far enough apart that I've ended up positioning one Arduino at each end of the yard, controlling five servos each. One Arduino is on COM4 and the other on COM5. I've got a pair of the "" scripts created, one of which I'll refer to as P, the other S. On the one, I've renamed the global extportin to extportinP and the other script has extportinS. Com ports correspond to the Arduino ports. I've created a panel that has a basic diagram of the staging yard and can control the turnouts. This is where I am running into problems. I had JMRI automatically load the panel and run both scripts (P first, then S). The S turnouts worked normally but the P turnouts did not. I stopped the scripts from running automatically and have managed to test my way to the following:

1. If I load the P script (automatically or manually, doesn't make a difference), all the P turnouts work normally.
2. If I then load the S script, all the S turnouts work normally but the P turnouts stop responding, although the script output and panel act like they are working.
3. It doesn't matter which script is loaded first; the second script will stop the first script's turnouts.

Any thoughts on why this may be happening?


Bob Jacobsen

Join to automatically receive all group messages.