I have DCC++ on an Arduino Mega and Motor shield. In the Serial monitor I program a pin as an output I put in <Z 1 24 0 0> and a sensor I put in <S 1 25 1>. In JMRI I set up a light and a sensor. I trigger the sensor and it shows "active" and the light button shows "on" but the light does not go on. any idea what is wrong?
by my understanding of the code, this should be: Code: <Z 1 24 0> unless something has changed, that i am unaware of, the command needs 3 arguments: Id, Pin, and iFlag. ~Travis
Thanks for the fast repy When I type in <Z 1 24 0>, Then <Z> to list it comes back as <Y1 24 0 0> And still no light
I am assuming you are using the original code? there are slight variations between my code, and the original. allow me to study the original code, and i will see if i am telling you correctly. i think i am, based on the DCC++ Wiki ( https://github.com/DccPlusPlus/BaseStation/wiki/Commands-for-DCCpp-BaseStation ), but the lack of output state change, other than by changing the iflag is confusing. particularly when the iflag can turn it on and off, yet the commands do not. Have you tried using the write to EEPROM command: <E> then a manual state change of the output: <Z 1 1> or: <Z 1 0> ~Travis
ok, great. so your DCC++ base station is working! i would lean toward suspecting it is something in JMRI then. I use JMRI, but all the in's and out's are not my strongest knowledge base. my best guess would be to check the logic you have programmed between the sensor and the light. ~Travis
maybe I'm setting up the light in JMRI wrong? TOOLS TABLES LIGHTS ADD System Connection DCC++ Harware Address 1 Create On the Light Table the only thing on the list is DL1 I click the state button and i see an LED on the Arduino Mega labled RX flash when i click the button but the light does not come on
i am wondering if the hardware address of your light (1) and your sensor (1) are in conflict. my hardware is quite a bit different, so i can't test locally. ~Travis
I don't know JMRI but to configure an output pin on std DCC++ you need to enter 3 parameters - < Z ID PIN IFLAG > IFLAG can be 0 - 7 and the three bits configure for example if you want the pin active high or active low and how you want the pin set after a controller reboot. My understanding is that the ID must be unique for that setting so can't be also used for a sensor etc. for example <Z 100 25 0> then store it in EEPROM using <E> then to change the state of that pin (pin25 in this case) you send <Z 100 1> or <Z 100 0> Its explained more detail on this page: https://github.com/DccPlusPlus/BaseStation/wiki/Commands-for-DCCpp-BaseStation
Played with it for a few hours and still no light. I know it's in the JMRI and will get more time next weekend.