mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 04:41:24 +01:00
z Commands
This commit is contained in:
parent
94d0aa92d9
commit
f0ee8aeb85
@ -344,6 +344,20 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
|
||||
return;
|
||||
break;
|
||||
|
||||
case 'z': // direct pin manipulation
|
||||
if (p[0]==0) break;
|
||||
if (params==1) { // <z vpin | -vpin>
|
||||
if (p[0]>0) IODevice::write(p[0],HIGH);
|
||||
else IODevice::write(-p[0],LOW);
|
||||
return;
|
||||
}
|
||||
if (params>=2 && params<=4) { // <z vpin ana;og profile duration>
|
||||
// unused params default to 0
|
||||
IODevice::writeAnalogue(p[0],p[1],p[2],p[3]);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'Z': // OUTPUT <Z ...>
|
||||
if (parseZ(stream, params, p))
|
||||
return;
|
||||
@ -516,9 +530,7 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
|
||||
StringFormatter::send(stream, F("<iDCC-EX V-%S / %S / %S G-%S>\n"), F(VERSION), F(ARDUINO_TYPE), DCC::getMotorShieldName(), F(GITHUB_SHA));
|
||||
CommandDistributor::broadcastPower(); // <s> is the only "get power status" command we have
|
||||
Turnout::printAll(stream); //send all Turnout states
|
||||
Output::printAll(stream); //send all Output states
|
||||
Sensor::printAll(stream); //send all Sensor states
|
||||
// TODO Send stats of speed reminders table
|
||||
return;
|
||||
|
||||
#ifndef DISABLE_EEPROM
|
||||
|
@ -50,9 +50,12 @@ Note: Turnouts are best defined in myAutomation.h where a turnout description ca
|
||||
<T id DCC linearaddr>
|
||||
Valid commands respond with <O>
|
||||
|
||||
Outputs (Used by JMRI, not required by EXRAIL)
|
||||
<Z id vpin active> Define an output pin that JMRI can set by id
|
||||
<Z id activate> Activate an output pin by id
|
||||
Direct pin manipulation (replaces <Z commands, no predefinition required)
|
||||
<z vpin> Set pin LOW
|
||||
<z -vpin> Set pin HIGH
|
||||
<z vpin value> Set pin analog value
|
||||
<z vpin value profile> Set pin analig with profile
|
||||
<z vpin value profile duration> set pin analog with profile and value
|
||||
|
||||
|
||||
Sensors (Used by JMRI, not required by EXRAIL)
|
||||
@ -172,6 +175,9 @@ Obsolete commands/formats
|
||||
<W cv value obsolete obsolete>
|
||||
<R cv> V command is much faster if prediction is correct.
|
||||
<B cv bit value> V command is much faster if prediction is correct.
|
||||
<Z id vpin active> (use <z) Define an output pin that JMRI can set by id
|
||||
<Z id activate> (use <z) Activate an output pin by id
|
||||
|
||||
|
||||
Broadcast responses
|
||||
Note: broadcasts are sent to all throttles when appropriate (usually because something has changed)
|
||||
|
@ -4,7 +4,8 @@
|
||||
#include "StringFormatter.h"
|
||||
|
||||
|
||||
#define VERSION "4.2.34"
|
||||
#define VERSION "4.2.35"
|
||||
// 4.2.35 - add <z> direct pin manipulation command
|
||||
// 4.2.34 - Completely fix EX-IOExpander analogue inputs
|
||||
// 4.2.33 - Fix EX-IOExpander non-working analogue inputs
|
||||
// 4.2.32 - Fix LCD/Display bugfixes from 4.2.29
|
||||
|
Loading…
Reference in New Issue
Block a user