Skip to content

Cookbook Connecting Secondary Command Source

Asbelos edited this page Mar 30, 2021 · 3 revisions

You may need this if you are implementing a separate throttle interface which sends JMRI-like DCC++ throttle commands <t> <f> etc. You can create additional serial inputs (reading JMRI like commands) by doubling up on the various serial statements in your .ino file.

DCCEXParser serialParser;
DCCEXParser serial1Parser;
 ...

Serial.begin(115200);
Serial1.begin(115200);

... 

serialParser.loop(Serial);
serial1Parser.loop(Serial1);

Remember to avoid the Serialx used by your Wifi (if any).

Note: Sending throttle or turnout commands from more than one source will not confuse CommandStation BUT the replies will NOT be sent to the other Serial so care is advised. If you are using the WiThrottle Interface instead, this is not an issue.