diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 9e2cf5f..4d97b20 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -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) { // + if (p[0]>0) IODevice::write(p[0],HIGH); + else IODevice::write(-p[0],LOW); + return; + } + if (params>=2 && params<=4) { // + // unused params default to 0 + IODevice::writeAnalogue(p[0],p[1],p[2],p[3]); + return; + } + break; + case 'Z': // OUTPUT if (parseZ(stream, params, p)) return; @@ -516,9 +530,7 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) StringFormatter::send(stream, F("\n"), F(VERSION), F(ARDUINO_TYPE), DCC::getMotorShieldName(), F(GITHUB_SHA)); CommandDistributor::broadcastPower(); // 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 diff --git a/Release_Notes/CommandRef.md b/Release_Notes/CommandRef.md index c06e388..9d328d7 100644 --- a/Release_Notes/CommandRef.md +++ b/Release_Notes/CommandRef.md @@ -50,9 +50,12 @@ Note: Turnouts are best defined in myAutomation.h where a turnout description ca Valid commands respond with -Outputs (Used by JMRI, not required by EXRAIL) - Define an output pin that JMRI can set by id - Activate an output pin by id +Direct pin manipulation (replaces Set pin LOW + Set pin HIGH + Set pin analog value + Set pin analig with profile + set pin analog with profile and value Sensors (Used by JMRI, not required by EXRAIL) @@ -172,6 +175,9 @@ Obsolete commands/formats V command is much faster if prediction is correct. V command is much faster if prediction is correct. + (use (use 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