<h1>Page Not Found</h1>

<p>Sorry, we couldn't find that page.</p>

<p>Try using the search box or go to the <a href="/index.html">homepage</a>.</p>

Example - ROUTEs with DCC accessory turnouts and signals on Mega2560 direct I/O pins

Example - ROUTEs with turnouts/signals on Mega2560 direct I/O pins

Example - ROUTEs with turnouts/signals on MCP23017 I/O expander Vpins

Example - ROUTEs with servo based turnouts/signals on a PCA9685 servo module

Example - Full automation with pin based turnouts and signals on Mega2560 direct I/O pins

Example - Full automation with pin based turnouts/points and signals on MCP23017 I/O expander Vpins

Example - Full automation with servo based turnouts/points and signals with a PCA9685 servo module

<a href="../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation&thinsp;/&thinsp;Booster One Express</span></a>

Version 5 progress and a breaking change in the development branch

Announcing EX-SensorCAM - a new camera-based sensor for your layout

Battery Power, Radio Control: ProMiniAir Transmitter Integrated with a WiFi-equipped 

How does EX-CommandStation compare to commercial Command Stations

Calculating EX-Turntable positions and DCC phase/polarity switching

Using a Capacitive Discharge Unit (CDU) - single solenoid/coil turnouts

Using a Capacitive Discharge Unit (CDU) - dual solenoid/coil turnouts

Locontrol (iOS | JMRI Web Server, DCC-EX Native Commands | WiFi)

DigiTrainsPro (Android, iOS, Windows | WiThrottle, DCC-EX Native Commands | WiFi)

Create a Static IP for your Command Station in Access Point Mode

Using Engine Driver (or other WiThrottle Protocol Throttle) - Requires WiFi

Considerations when using geared steppers, turntables, and/or microsteps

Advertising positions to Engine Driver and WiThrottle applications

 - Automatically start sequence at this point during EX-CommandStation startup

 - A general purpose sequence, not advertised to throttles/clients

 - Completes a Sequence/Route/Animation/Event, or any other automation

 … ELSE … ENDIF  - Execute commands if the conditions are NOT met

 - Define event handler for when a signal is set to the red aspect

``TURNOUT( turnout_id, addr, sub_addr [, "description"]|HIDDEN )``

SERVO_TURNOUT( turnout_id, pin, active_angle, inactive_angle, profile [, "description"]|HIDDEN )

``SERVO_TURNOUT( turnout_id, pin, active_angle, inactive_angle, profile [, "description"]|HIDDEN )``

 - Define a virtual turnout, which is backed by another automation sequence

TT_ADDPOSITION( id, position_id, value, angle [, "description"] )

``TT_ADDPOSITION( id, position_id, value, angle [, "description"] )``

 - Wait for EX-Turntable turntable/traverser to complete a rotation

 - Causes a sequence to wait until after a sensor has been triggered

 - Causes a sequence to wait until either a sensor is active/triggered, or if the timer runs out

 - Tests if “timed out” flag has been set by an ATTIMEOUT() sensor reading attempt

 - Sends a DCC accessory packet with value 1 to a linear address

 - Sends a DCC accessory packet with value 0 to a linear address

 - perform commands if the specified loco ID is defined for this sequence

<a href="../exrail/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">RAIL</span></a>

Reasons to use EXRAIL rather than extra software and/or hardware

JMRI Jython.py script to Add Custom DCC-EX Buttons to DecoderPro & PanelPro menus

Comprehensive DCC-EX & JMRI DecoderPro Getting Started Guide PDF

<a href="../../../index.html"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a>

4. Compile and Re-upload EX-CommandStation software to the Arduino

Modifying Your Motor Board Definition To Give The Correct Current Sense Factor

Why does the Mega/ESP32/Nucleo with Standard motor driver need two power supplies?

Using one power supply with cheap converters to power everything

 - Request a deliberate update on the cab (loco) speed/functions

<span style="font-weight: bold; font-style: italic; color:red">Deprecated</span>

 - Request all position details of the specified turntable/traverser

 - Request the DCC-EX version and hardware info, along with listing defined turnouts

Reading/Writing Configuration Variables (CVs) - Programming track

 - Verify/Read bit of Configuration Variable (CV) with guessed value

 - Verify/Read of Configuration Variable (CV) with guessed value

:dcc-ex-red-bold-italic:`Deprecated, please use <W cv value> instead`

:dcc-ex-red-bold-italic:`Deprecated, please use <w cv value> instead`

 - Define turnout/point on a DCC Accessory Decoder with the specified address and subaddress

 - Define turnout/point on a DCC Accessory Decoder with the specified linear address

 - Define a turnout on a DCC Accessory Decoder with the specified address and subaddress - Legacy command 

 - Define a turnout/point servo on specified vpin - Legacy command 

Diagnostic Programming Commands (Configuring the EX-CommandStation)

 - Shows configured servo board and GPIO extender board config and used pins

The following commands turn ON(1) or OFF(0) various diagnostic traces

Connect directly to the Signal output (enable pin) of the Arduino CS

Track power is cut when locomotive enters turntable bridge track

Checking the AT version of a ESP-01 a with a USB to TTL CH340G Converter Module Adapter

Checking the AT version of a Duinopeak ESP8266 WiFi Expansion Board

Correcting the Makerfabs ESP8266 WiFi Shield With a USB to TTL Converter Module Adapter

Correcting the Makerfabs ESP8266 WiFi Shield With an Arduino Mega

Correcting the AT version on a Duinopeak ESP8266 WiFi Expansion Board

EX-CommandStation Specific Features - when using the DCC-EX Native Protocol

:doc:`DCC-EX Native Protocol </reference/software/withrottle-vs-native-commands>`

EXRAIL list of Track Manager Functions for Engine Driver Automatic Assign [Handoff] buttons

EXRAIL Track Manager Functions for Engine Driver ‘Automation’ [Handoff] buttons

EXRAIL Track Manager Functions for Engine Driver ‘Route’ [Set] buttons

about/contributing/development:contributing to the hardware & software

about/contributing/development:bug fixes, features, and releases

about/contributing/development:level of c++ understanding required

about/contributing/development:reading and understanding our code

about/contributing/development:reliance on the c++ pre-processor

about/contributing/github:git terms: fork, branch, pull request, and merge

about/contributing/overview:what do i need to be able to contribute?

about/contributing/overview:development, planning, and support processes

about/contributing/release-process:versioning and the release process

about/contributing/software:enabling live documentation previews

about/contributing/website/basic-rst:internal - to a heading in a different page

about/contributing/website/basic-rst:internal - to a different page

about/contributing/website/basic-rst:internal - to a sub heading of a different page

about/contributing/website/basic-rst:downloads or important links

about/contributing/website/basic-rst:drawing and saving graphs and schemas

about/contributing/website/basic-rst:image artifacts / original grpahics

about/contributing/website/getting-started:documentation - getting started

about/contributing/website/getting-started:github pages, sphinx, and restructuredtext

about/contributing/website/getting-started:github repository and the sphinx branch

about/contributing/website/getting-started:1. cloning the repository on github website

about/contributing/website/getting-started:2. download the repository to your pc with githib desktop

about/contributing/website/getting-started:3. open the repository in vscode

about/contributing/website/getting-started:esbonio language server

about/contributing/website/getting-started:emulate github pages deployment

about/contributing/website/getting-started:6. push your changes to your github repository

about/contributing/website/getting-started:7. creating a *pull request* to send your changes for review

about/contributing/website/getting-started:a. get any changes to your repository on github website

about/contributing/website/getting-started:b. pull the changes to your repository on your pc

about/contributing/website/getting-started:your own github pages

about/contributing/website/index:contributing to the documentation

about/contributing/website/publishing-news:publishing dcc-ex news posts

about/contributing/website/publishing-news:using the post-template.txt template

about/contributing/website/publishing-news:updating the metadata (date, author, category, tags)

about/contributing/website/publishing-news:valid categories and tags

about/contributing/website/requirements:what you need to know/learn

about/contributing/website/requirements:hidden pages (not ready for release)

about/contributing/website/structure:on this page - table of contents

about/contributing/website/structure:next steps - restucturedtext basics

about/media-resources/index:public mention of dcc-ex (articles, youtube videos, etc)

begin/comparison:why dcc-ex? - comparing ex-commandstation to commercial systems

begin/what-to-know:dcc-ex is for more than just controlling trains

begin/what-to-know:i'm interested in dcc but have a limited budget

begin/what-to-know:i want to operate my turnouts/points and run trains

begin/what-to-know:i want to control all my accessories and run trains

begin/what-to-know:i want a fully automated exhibition layout for my club

begin/what-to-know:how does ex-commandstation compare to commercial command stations

big-picture/stage1:run a train on your wifi enabled ex-commandstation

big-picture/stage1:run a train on your jmri connected ex-commandstation

big-picture/stage1:run more than one train (individual or consist/multiple units)

big-picture/stage2:add images for your locos (engine driver only)

big-picture/stage3:stage 3 - turnouts/points, accessories, sensors & blocks

big-picture/stage3:configure the software - myautomation.h - turnouts/points

big-picture/stage3:configure the software - myautomation.h - sensors

big-picture/stage3:configure the software - myautomation.h - blocks

big-picture/stage5:add an ex-turntable to your ex-commandstation

big-picture/stage5:calculating ex-turntable positions and dcc phase/polarity switching

big-picture/stage5:dcc phase/polarity switching angle calculation

big-picture/stage5/traverser-example:example - turntable and traverser routes

big-picture/stage6:exiting block 1 - station entry or main track?

big-picture/stage6:moving from block 1 to block 2 - continue on the main track

big-picture/stage6:moving from block 1 to block 3 - entering the station

big-picture/stage6:moving from block 2 to block 4 - continue on the main track

big-picture/stage6:moving from block 3 to block 4 - exiting the station siding

big-picture/stage6:moving from block 4 to block 1 - the speed run

big-picture/stage6/example1:example - routes with dcc accessory turnouts and signals on mega2560 direct i/o pins

big-picture/stage6/example2:example - routes with turnouts/signals on mega2560 direct i/o pins

big-picture/stage6/example3:example - routes with turnouts/signals on mcp23017 i/o expander vpins

big-picture/stage6/example4:example - routes with servo based turnouts/signals on a pca9685 servo module

big-picture/stage6/example5:example - full automation with pin based turnouts and signals on mega2560 direct i/o pins

big-picture/stage6/example6:example - full automation with pin based turnouts/points and signals on mcp23017 i/o expander vpins

big-picture/stage6/example7:example - full automation with servo based turnouts/points and signals with a pca9685 servo module

download/ex-commandstation:latest ex-commandstation official release

download/ex-commandstation:latest ex-commandstation unreleased development version

download/ex-commandstation:ex-commandstation repository (project source files)

ex-commandstation/accessories/animation:automation and animation

ex-commandstation/accessories/index:adding and controlling accessories

ex-commandstation/accessories/inputs-outputs/duinonodes:lew's duino gear duinonodes

ex-commandstation/accessories/inputs-outputs/duinonodes:dnin8/dnin8k digital input duinonode

ex-commandstation/accessories/inputs-outputs/duinonodes:dnou8/dnou8k digital output duinonode

ex-commandstation/accessories/inputs-outputs/index:input and output accessories and expanders

ex-commandstation/accessories/sensors/ir-sensor:infrared or ir sensors

ex-commandstation/accessories/sensors/ir-sensor:reflection mode sensors

ex-commandstation/accessories/sensors/ir-sensor:beam break mode sensors

ex-commandstation/accessories/sensors/ir-sensor:adafruit beam break sensors

ex-commandstation/accessories/sensors/ir-sensor:modulated ir sensor software

ex-commandstation/accessories/sensors/ir-sensor:sensor configuration for jmri

ex-commandstation/accessories/sensors/vl53l0x-tof-sensor:vl53l0x time of flight sensor

ex-commandstation/accessories/sensors/vl53l0x-tof-sensor:theory of operation

ex-commandstation/accessories/sensors/vl53l0x-tof-sensor:connecting a single device

ex-commandstation/accessories/sensors/vl53l0x-tof-sensor:configuring a single device

ex-commandstation/accessories/sensors/vl53l0x-tof-sensor:sensor configuration for jmri

ex-commandstation/accessories/sensors/which-sensor-type:which sensor type to use?

ex-commandstation/accessories/sensors/which-sensor-type:hall effect sensors

ex-commandstation/accessories/signals/dcc-signals:dcc accessory signals

ex-commandstation/accessories/signals/dcc-signals:important considerations for dcc accessory signals

ex-commandstation/accessories/signals/dcc-signals:defining dcc accessory signals

ex-commandstation/accessories/signals/dcc-signals:connecting the signals

ex-commandstation/accessories/signals/dcc-signals:controlling your dcc signals

ex-commandstation/accessories/signals/light-signals:important considerations for light signals

ex-commandstation/accessories/signals/light-signals:defining light signal objects

ex-commandstation/accessories/signals/light-signals:what if i don't have three aspect signals?

ex-commandstation/accessories/signals/light-signals:what if my signals have different colours?

ex-commandstation/accessories/signals/light-signals:signals with flashing amber

ex-commandstation/accessories/signals/light-signals:connecting the signals

ex-commandstation/accessories/signals/light-signals:active low signals

ex-commandstation/accessories/signals/light-signals:active high signals

ex-commandstation/accessories/signals/light-signals:controlling light signals

ex-commandstation/accessories/signals/servo-signals:semaphore or servo signals

ex-commandstation/accessories/signals/servo-signals:important considerations for servo operation

ex-commandstation/accessories/signals/servo-signals:defining semaphore or servo signal objects

ex-commandstation/accessories/signals/servo-signals:what if i don't have three aspect signals?

ex-commandstation/accessories/signals/servo-signals:connecting the signals

ex-commandstation/accessories/signals/servo-signals:controlling semaphore or servo signals

ex-commandstation/accessories/signals/signal-control:light and semaphore or servo signals

ex-commandstation/accessories/signals/signal-control:interactive control with dcc-ex commands

ex-commandstation/accessories/signals/signal-control:automated control with exrail commands

ex-commandstation/accessories/signals/signal-control:signal event handlers

ex-commandstation/accessories/signals/signal-control:controlling dcc accessory signals

ex-commandstation/accessories/signals/signal-control:dcc accessory event handlers

ex-commandstation/accessories/signals/signal-control:controlling signals with more than three aspects

ex-commandstation/accessories/signals/signal-control:semaphore or servo signals

ex-commandstation/accessories/signals/signal-control:dcc accessory signals

ex-commandstation/accessories/signals/signal-overview:signalling overview - types and options

ex-commandstation/accessories/signals/signal-overview:what are signals?

ex-commandstation/accessories/signals/signal-overview:semaphore (or servo) signals

ex-commandstation/accessories/signals/signal-overview:dcc accessory signals

ex-commandstation/accessories/turnouts/overview:overview - types and options

ex-commandstation/accessories/turnouts/overview:what is a turnout or point?

ex-commandstation/accessories/turnouts/overview:dcc accessory turnouts/points

ex-commandstation/accessories/turnouts/overview:turnout/point control options

ex-commandstation/accessories/turnouts/overview:the turnout object

ex-commandstation/accessories/turnouts/overview:defining turnout objects

ex-commandstation/accessories/turnouts/overview:turnout/point control, hardware, and configuration

ex-commandstation/accessories/turnouts/servo-turnouts:important considerations for servo operation

ex-commandstation/accessories/turnouts/servo-turnouts:defining servo based turnout objects

ex-commandstation/accessories/turnouts/servo-turnouts:connecting the hardware

ex-commandstation/accessories/turnouts/solenoid-turnouts:solenoid or coil turnouts/points

ex-commandstation/accessories/turnouts/solenoid-turnouts:important considerations for solenoid/coil turnouts/points

ex-commandstation/accessories/turnouts/solenoid-turnouts:defining solenoid/coil based turnout objects

ex-commandstation/accessories/turnouts/solenoid-turnouts:connecting and controlling the hardware

ex-commandstation/accessories/turnouts/solenoid-turnouts:using an l293d motor driver - single solenoid/coil turnouts

ex-commandstation/accessories/turnouts/solenoid-turnouts:using an l293d motor driver - dual solenoid/coil turnouts

ex-commandstation/accessories/turnouts/solenoid-turnouts:using a capacitive discharge unit (cdu) - single solenoid/coil turnouts

ex-commandstation/accessories/turnouts/solenoid-turnouts:using a capacitive discharge unit (cdu) - dual solenoid/coil turnouts

ex-commandstation/accessories/turnouts/solenoid-turnouts:option 1 - diy cdu by "rosscoe" (dcc-ex user on discord)

ex-commandstation/accessories/turnouts/solenoid-turnouts:notes on some specific hardware

ex-commandstation/accessories/turnouts/solenoid-turnouts:connecting a tortoise

ex-commandstation/accessories/turntables/dcc-turntables:dcc-ex native command example

ex-commandstation/accessories/turntables/dcc-turntables:exrail command example

ex-commandstation/accessories/turntables/index:turntables and traversers

ex-commandstation/accessories/turntables/overview:overview - types and options

ex-commandstation/accessories/turntables/overview:what is a turntable or traverser?

ex-commandstation/accessories/turntables/overview:the turntable object

ex-commandstation/accessories/turntables/overview:defining turntable objects

ex-commandstation/accessories/turntables/overview:dcc accessory turntables

ex-commandstation/accessories/turntables/overview:read on for more...

ex-commandstation/advanced-setup/controllers:choosing a throttle (controller) - advanced

ex-commandstation/advanced-setup/controllers:wireless connection details

ex-commandstation/advanced-setup/controllers:direct (without jmri)

ex-commandstation/advanced-setup/controllers:indirect (without jmri)

ex-commandstation/advanced-setup/controllers:command language (api)

ex-commandstation/advanced-setup/controllers:compatible throttles (controllers)

ex-commandstation/advanced-setup/controllers:our ex-webthrottle (dcc-ex | usb/serial)

ex-commandstation/advanced-setup/controllers:phone/tablet throttle apps

ex-commandstation/advanced-setup/controllers:engine driver (android | withrottle | wifi)

ex-commandstation/advanced-setup/controllers:withrottle (ios | withrottle | wifi)

ex-commandstation/advanced-setup/controllers:dccpp cab (android | dcc-ex native commands | wifi, bluetooth)

ex-commandstation/advanced-setup/controllers:locontrol (ios | jmri web server, dcc-ex native commands | wifi)

ex-commandstation/advanced-setup/controllers:digitrainspro (android, ios, windows | withrottle, dcc-ex native commands | wifi)

ex-commandstation/advanced-setup/controllers:srcpclient (ios | withrottle, dcc-ex native commands | wifi)

ex-commandstation/advanced-setup/controllers:complete list of apps

ex-commandstation/advanced-setup/controllers:connecting via usb cable

ex-commandstation/advanced-setup/controllers:usb wireless bridge

ex-commandstation/advanced-setup/controllers:2 wires to arduino serial port

ex-commandstation/advanced-setup/index:steps to build an ex-commandstation

ex-commandstation/advanced-setup/index:throttle (controller) options

ex-commandstation/advanced-setup/index:features under development

ex-commandstation/advanced-setup/installation-options/arduino-ide:install using the arduino ide

ex-commandstation/advanced-setup/installation-options/arduino-ide:download and install the arduino ide

ex-commandstation/advanced-setup/installation-options/arduino-ide:download the dcc-ex zip file

ex-commandstation/advanced-setup/installation-options/arduino-ide:unzip the file into the arduino ide project folder

ex-commandstation/advanced-setup/installation-options/arduino-ide:copy the config.example.h file (or rename it)

ex-commandstation/advanced-setup/installation-options/arduino-ide:run the arduino ide

ex-commandstation/advanced-setup/installation-options/arduino-ide:open the commandstation-ex project

ex-commandstation/advanced-setup/installation-options/arduino-ide:edit the config.h file (optional)

ex-commandstation/advanced-setup/installation-options/arduino-ide:select the board type and com port

ex-commandstation/advanced-setup/installation-options/arduino-ide:plug in your power adapters

ex-commandstation/advanced-setup/installation-options/arduino-ide:use the serial monitor to do a quick test

ex-commandstation/advanced-setup/installation-options/arduino-ide:type in a command or two

ex-commandstation/advanced-setup/startup-config:if you are using ex-installer

ex-commandstation/advanced-setup/startup-config:if you are using the arduino ide

ex-commandstation/advanced-setup/startup-config:create a new tab

ex-commandstation/advanced-setup/startup-config:creating the mysetup.h file

ex-commandstation/advanced-setup/startup-config:adding in the startup commands

ex-commandstation/advanced-setup/startup-config:adding in more than one startup command

ex-commandstation/advanced-setup/startup-config:upload the new version of the software

ex-commandstation/advanced-setup/startup-config:automatically turning track power on at startup

ex-commandstation/advanced-setup/supported-connections/direct:connection type: direct to command station

ex-commandstation/advanced-setup/supported-connections/jmri:connection type: direct to command station through jmri

ex-commandstation/advanced-setup/supported-connections/wifi-setup:why use wifi?

ex-commandstation/advanced-setup/supported-connections/wifi-setup:what you will need (for wifi)

ex-commandstation/advanced-setup/supported-wifi/index:supported wifi shields and boards

ex-commandstation/advanced-setup/supported-wifi/wifi-config:connection type: direct to command station or through jmri

ex-commandstation/advanced-setup/supported-wifi/wifi-config:what's a "withrottle server"?

ex-commandstation/advanced-setup/supported-wifi/wifi-config:access point mode vs. station mode

ex-commandstation/advanced-setup/supported-wifi/wifi-config:access point mode

ex-commandstation/advanced-setup/supported-wifi/wifi-config:access point mode (default - no configuration necessary)

ex-commandstation/advanced-setup/supported-wifi/wifi-config:connecting to the access point

ex-commandstation/advanced-setup/supported-wifi/wifi-config:connecting to your network - station mode "sta" (edit config.h)

ex-commandstation/advanced-setup/supported-wifi/wifi-config:wifi config options

ex-commandstation/advanced-setup/supported-wifi/wifi-config:#define ip_port 2560

ex-commandstation/advanced-setup/supported-wifi/wifi-config:#define wifi_ssid "your network name"

ex-commandstation/advanced-setup/supported-wifi/wifi-config:#define wifi_password "your network passwd"

ex-commandstation/advanced-setup/supported-wifi/wifi-config:#define ip_address { 192, 168, 1, 200 }

ex-commandstation/advanced-setup/supported-wifi/wifi-config:#define mac_address { 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xef }

ex-commandstation/advanced-setup/supported-wifi/wifi-config:clearing the esp-wifi ssid settings

ex-commandstation/advanced-setup/supported-wifi/wifi-config:if you want to run in access point (ap) mode

ex-commandstation/advanced-setup/supported-wifi/wifi-config:if you want to change your network login

ex-commandstation/advanced-setup/supported-wifi/wifi-config:tips and tricks

ex-commandstation/advanced-setup/supported-wifi/wifi-config:temporarily log into a different network

ex-commandstation/advanced-setup/supported-wifi/wifi-config:create a static ip for your command station in access point mode

ex-commandstation/controllers-diy:choosing a throttle (controller)

ex-commandstation/controllers-diy:what you need & why you need it

ex-commandstation/controllers-diy:engine driver (android \| withrottle \| wifi)

ex-commandstation/controllers-diy:withrottle lite (ios \| withrottle \| wifi)

ex-commandstation/controllers-diy:our ex-webthrottle (dcc-ex native commands | usb/serial)

ex-commandstation/controllers-diy:next steps - testing your setup

ex-commandstation/controllers-esb1:choosing a throttle (controller)

ex-commandstation/controllers-esb1:what you need & why you need it

ex-commandstation/controllers-esb1:throttle (controller) options

ex-commandstation/controllers-esb1:engine driver (android \| withrottle \| wifi)

ex-commandstation/controllers-esb1:withrottle lite (ios \| withrottle \| wifi)

ex-commandstation/controllers-esb1:our ex-webthrottle (dcc-ex native commands | usb/serial)

ex-commandstation/controllers-esb1:next steps - testing your setup

ex-commandstation/controllers-rtr:choosing a throttle (controller)

ex-commandstation/controllers-rtr:what you need & why you need it

ex-commandstation/controllers-rtr:engine driver (android \| withrottle \| wifi)

ex-commandstation/controllers-rtr:withrottle lite (ios \| withrottle \| wifi)

ex-commandstation/controllers-rtr:our ex-webthrottle (dcc-ex native commands | usb/serial)

ex-commandstation/controllers-rtr:next steps - testing your setup

ex-commandstation/diy/assembly:1. disable power sharing - arduino to motor driver

ex-commandstation/diy/assembly:3. connect the motor driver power supply

ex-commandstation/diy/assembly:4. connect the power wires to the tracks

ex-commandstation/diy/assembly:5. connect the arduino power supply

ex-commandstation/diy/assembly:next steps - install the wifi board

ex-commandstation/diy/index:the components of a full ex-commandstation

ex-commandstation/diy/wifi-setup:makerfabs esp8266 wifi shield - installation instructions

ex-commandstation/diy/wifi-setup:next steps - install the software

ex-commandstation/include_controllers:choosing a throttle (controller)

ex-commandstation/include_controllers:what you need & why you need it

ex-commandstation/include_controllers:throttle (controller) options

ex-commandstation/include_controllers:engine driver (android \| withrottle \| wifi)

ex-commandstation/include_controllers:withrottle lite (ios \| withrottle \| wifi)

ex-commandstation/include_controllers:our ex-webthrottle (dcc-ex native commands | usb/serial)

ex-commandstation/include_controllers:next steps - testing your setup

ex-commandstation/include_installer:requirements (for installing)

ex-commandstation/include_installer:2. download and run ex-installer

ex-commandstation/include_installer:the 'ex-installer welcome' screen

ex-commandstation/include_installer:'select the product to install' screen

ex-commandstation/include_installer:'select ex-commandstation version' screen

ex-commandstation/include_installer:'install ex-commandstation' - configuration screen

ex-commandstation/include_installer:use my ex-commandstation as an access point

ex-commandstation/include_installer:connect my ex-commandstation to my existing wireless network

ex-commandstation/include_installer:next steps - selecting a throttle (controller)

ex-commandstation/include_testing:using engine driver or withrottle - requires wifi

ex-commandstation/index:ex-commandstation |br| |small-start| (ready-to-run or do-it-yourself) |small-end|

ex-commandstation/index:ready-to-run (rtr) or do-it-yourself (diy)

ex-commandstation/installer-diy:2. download and run ex-installer

ex-commandstation/installer-diy:the 'ex-installer welcome' screen

ex-commandstation/installer-diy:'select the product to install' screen

ex-commandstation/installer-diy:'select ex-commandstation version' screen

ex-commandstation/installer-diy:'install ex-commandstation' - configuration screen

ex-commandstation/installer-diy:use my ex-commandstation as an access point

ex-commandstation/installer-diy:connect my ex-commandstation to my existing wireless network

ex-commandstation/installer-diy:next steps - selecting a throttle (controller)

ex-commandstation/installer-esb1:2. download and run ex-installer

ex-commandstation/installer-esb1:the 'ex-installer welcome' screen

ex-commandstation/installer-esb1:'select the product to install' screen

ex-commandstation/installer-esb1:'select ex-commandstation version' screen

ex-commandstation/installer-esb1:'install ex-commandstation' - configuration screen

ex-commandstation/installer-esb1:use my ex-commandstation as an access point

ex-commandstation/installer-esb1:connect my ex-commandstation to my existing wireless network

ex-commandstation/installer-esb1:next steps - selecting a throttle (controller)

ex-commandstation/installer-rtr:2. download and run ex-installer

ex-commandstation/installer-rtr:the 'ex-installer welcome' screen

ex-commandstation/installer-rtr:'select the product to install' screen

ex-commandstation/installer-rtr:'select ex-commandstation version' screen

ex-commandstation/installer-rtr:'install ex-commandstation' - configuration screen

ex-commandstation/installer-rtr:use my ex-commandstation as an access point

ex-commandstation/installer-rtr:connect my ex-commandstation to my existing wireless network

ex-commandstation/installer-rtr:next steps - selecting a throttle (controller)

ex-commandstation/rtr-booster:ex-csb1 as a dcc booster (booster mode)

ex-commandstation/rtr-connecting:connecting your command station

ex-commandstation/rtr-connecting:connecting your throttle (controller)

ex-commandstation/rtr-connecting:connect the smart device to the ex-csb1 ap network

ex-commandstation/rtr-connecting:run the engine driver setup wizard

ex-commandstation/rtr-connecting:connect engine driver to ex-commandstation

ex-commandstation/rtr-connecting__included-esb1:ex-csb1 quick setup guide

ex-commandstation/rtr-connecting__included-esb1:what you will need

ex-commandstation/rtr-connecting__included-esb1:summary or super-quick start

ex-commandstation/rtr-connecting__included-esb1:connecting your command station

ex-commandstation/rtr-connecting__included-esb1:testing your command station

ex-commandstation/rtr-connecting__included-esb1:connect track input power

ex-commandstation/rtr-connecting__included-esb1:connecting your throttle (controller)

ex-commandstation/rtr-connecting__included-esb1:connect the smart device to the ex-csb1 ap network

ex-commandstation/rtr-connecting__included-esb1:run the engine driver setup wizard

ex-commandstation/rtr-connecting__included-esb1:connect engine driver to ex-commandstation

ex-commandstation/rtr-connecting__included-esb1:acquire your loco

ex-commandstation/rtr-connecting__included-esb1:full ex-csb1 operating manual

ex-commandstation/rtr-index:looking for some help with your ex-csb1?

ex-commandstation/rtr-manual:esp32 microcontroller / wifi / wifi antenna

ex-commandstation/rtr-manual:connecting and testing your command station

ex-commandstation/rtr-manual:connecting via usb and ex-webthrottle

ex-commandstation/rtr-manual:use trackmanager to set outputs to dcc or dc operation

ex-commandstation/rtr-manual:uploading the software (changing the configuration)

ex-commandstation/rtr-manual:step 1: connect the ex-csb1 to your computer

ex-commandstation/rtr-manual:step 2: install the required usb drivers

ex-commandstation/rtr-manual:step 3: download and run the ex-installer program

ex-commandstation/rtr-manual:step 2: connect to your computer via usb

ex-commandstation/rtr-manual:step 3: download the latest installer

ex-commandstation/rtr-manual:launch the command station software

ex-commandstation/rtr-manual:connecting optional devices and accessories

ex-commandstation/rtr-manual:step 1: selecting |i2c| accessories

ex-commandstation/rtr-manual:step 2: connecting accessories to ex-csb1

ex-commandstation/rtr-manual:step 3: installing and running the dcc-ex installer

ex-commandstation/rtr-manual:step 4: manual configuration for advanced accessories

ex-commandstation/rtr-manual__included-esb1:ex-csb1 operating manual

ex-commandstation/rtr-manual__included-esb1:input power barrel jack

ex-commandstation/rtr-manual__included-esb1:usb-c power/data connector

ex-commandstation/rtr-manual__included-esb1:track a and b outputs

ex-commandstation/rtr-manual__included-esb1:qwiic connector (i2c)

ex-commandstation/rtr-manual__included-esb1:esp32 microcontroller / wifi / wifi antenna

ex-commandstation/rtr-manual__included-esb1:oled display (not shown above)

ex-commandstation/rtr-manual__included-esb1:unpopulated power connector

ex-commandstation/rtr-manual__included-esb1:powering the ex-csb1

ex-commandstation/rtr-manual__included-esb1:connecting and testing your command station

ex-commandstation/rtr-manual__included-esb1:start with all power disconnected

ex-commandstation/rtr-manual__included-esb1:connecting to your tracks

ex-commandstation/rtr-manual__included-esb1:dcc operation - the default

ex-commandstation/rtr-manual__included-esb1:optional dc operation

ex-commandstation/rtr-manual__included-esb1:connecting a throttle

ex-commandstation/rtr-manual__included-esb1:connecting via usb and ex-webthrottle

ex-commandstation/rtr-manual__included-esb1:dc pulse width modulation (pwm)

ex-commandstation/rtr-manual__included-esb1:use trackmanager to set outputs to dcc or dc operation

ex-commandstation/rtr-manual__included-esb1:uploading the software (changing the configuration)

ex-commandstation/rtr-manual__included-esb1:first time connection

ex-commandstation/rtr-manual__included-esb1:step 1: connect the ex-csb1 to your computer

ex-commandstation/rtr-manual__included-esb1:step 2: install the required usb drivers

ex-commandstation/rtr-manual__included-esb1:automatic driver installation

ex-commandstation/rtr-manual__included-esb1:manual driver installation

ex-commandstation/rtr-manual__included-esb1:step 3: download and run the ex-installer program

ex-commandstation/rtr-manual__included-esb1:changing the configuration

ex-commandstation/rtr-manual__included-esb1:uploading exrail scripts

ex-commandstation/rtr-manual__included-esb1:step 1: disconnect power

ex-commandstation/rtr-manual__included-esb1:step 2: connect to your computer via usb

ex-commandstation/rtr-manual__included-esb1:use a compatible usb cable

ex-commandstation/rtr-manual__included-esb1:step 3: download the latest installer

ex-commandstation/rtr-manual__included-esb1:visit the dcc-ex website

ex-commandstation/rtr-manual__included-esb1:step 4: run ex-installer

ex-commandstation/rtr-manual__included-esb1:follow the on-screen instructions

ex-commandstation/rtr-manual__included-esb1:complete the installation

ex-commandstation/rtr-manual__included-esb1:step 5: verify the reset

ex-commandstation/rtr-manual__included-esb1:launch the command station software

ex-commandstation/rtr-manual__included-esb1:check the configuration

ex-commandstation/rtr-manual__included-esb1:step 6: reconfigure if necessary

ex-commandstation/rtr-manual__included-esb1:usb connection to a serial monitor

ex-commandstation/rtr-manual__included-esb1:usb connection to jmri

ex-commandstation/rtr-manual__included-esb1:connecting optional devices and accessories

ex-commandstation/rtr-manual__included-esb1:dcc-ex |i2c| hardware overview

ex-commandstation/rtr-manual__included-esb1:step 1: selecting |i2c| accessories

ex-commandstation/rtr-manual__included-esb1:step 2: connecting accessories to ex-csb1

ex-commandstation/rtr-manual__included-esb1:step 3: installing and running the dcc-ex installer

ex-commandstation/rtr-manual__included-esb1:step 4: manual configuration for advanced accessories

ex-commandstation/rtr-manual__included-esb1:adding an ex-motorshield 8874

ex-commandstation/rtr-purchasing:in the united states serving usa, canada, \& mexico

ex-commandstation/rtr-purchasing:in austria serving the european union (eu)

ex-commandstation/rtr-purchasing:in australia serving au, nz, and apac

ex-commandstation/testing-diy:using engine driver or withrottle - requires wifi

ex-commandstation/testing-esb1:using engine driver or withrottle - requires wifi

ex-commandstation/testing-rtr:using engine driver or withrottle - requires wifi

ex-csb1/index:in the united states serving usa, canada, \& mexico

ex-dccinspector/index:looking for some help with ex-dccinspector?

ex-installer/installing:using ex-installer - detailed instructions

ex-installer/installing:d. 'select the product to install' screen

ex-installer/installing:e. product specific screens - ex-commandstation

ex-installer/installing:i) 'select ex-commandstation version' screen

ex-installer/installing:ii) 'install ex-commandstation' - configuration screen

ex-installer/installing:use my ex-commandstation as an access point

ex-installer/installing:connect my ex-commandstation to my existing wireless network

ex-installer/installing-original-installer:using the installer (windows x32, macos or linux)

ex-installer/installing-original-installer:requirements (for installing)

ex-installer/installing-original-installer:2. download and run ex-installer

ex-installer/installing-original-installer:3. the ex-installer window

ex-installer/installing-original-installer:next steps - test your setup

ex-installer/managing-config-files:managing config files with the installer

ex-installer/testing:using engine driver (or other withrottle protocol throttle) - requires wifi

ex-ioexpander/other-devices:the ex-ioexpander communication protocol

ex-ioexpander/supported-devices:arduino zero (or samd based clone)

ex-ioexpander/supported-devices:stmicroelectronics stm32f103c8t6 (bluepill)

ex-ioexpander/supported-devices:enabling serial input/output in defines.h

ex-ioexpander/supported-devices:defining the device macros in defines.h

ex-ioexpander/supported-devices:defining the device type and pin map in <device_name>.h

ex-ioexpander/supported-devices:including the device specific file in ex-ioexpander.ino

ex-turntable/assembly:using a two wire stepper driver (e.g. a4988/drv8825/tmc2208)

ex-turntable/assembly:3. connect the stepper controller and motor

ex-turntable/assembly:configuration for two wire stepper drivers (e.g. a4988/drv8825)

ex-turntable/assembly:8. add the ex-turntable device driver to ex-commandstation

ex-turntable/assembly:9. connect ex-turntable to your ex-commandstation

ex-turntable/overview:considerations when using geared steppers, turntables, and/or microsteps

ex-turntable/test-and-tune:ex-turntable interactive serial console commands

ex-turntable/test-and-tune:testing with the ex-commandstation diagnostic command

ex-turntable/test-and-tune:basic dcc-ex native turntable definition and control

ex-turntable/test-and-tune:operation with manual phase switching

ex-turntable/test-and-tune:advertising positions to engine driver and withrottle applications

ex-turntable/test-and-tune:controlling ex-turntable with dcc-ex turntable controller

ex-turntable/traverser:traversers and limited rotation turntables

exrail/creating-elements:adding the hardware - dcc turnouts/points

exrail/creating-elements:configure myautomation.h - dcc turnouts/points

exrail/creating-elements:adding the hardware - pin turnouts/points

exrail/creating-elements:configure myautomation.h - pin turnouts/points

exrail/creating-elements:adding the hardware - servo turnouts/points

exrail/creating-elements:configure myautomation.h - servo turnouts/points

exrail/creating-elements:configure myautomation.h - servos for signals an animations

AUTOSTART - Automatically start sequence at this point during EX-CommandStation startup

AUTOMATION( id, "description" ) - Define an automation, advertised to throttles/clients

ROUTE( id, "description" ) - Define a route, advertised to throttles/clients

SEQUENCE( id ) - A general purpose sequence, not advertised to throttles/clients

DONE - Completes a Sequence/Route/Animation/Event, or any other automation

ENDTASK - Completes a Sequence/Route/Animation/Event, or any other automation

DELAYRANDOM( min_delay, max_delay ) - Delay a random period of time

IFRANDOM( percent ) - Run commands a random percentage of the time

ROUTE_CAPTION( route_id, "caption" ) - Change the label of the Route button

PICKUP_STASH( stash_id ) - Retrieves and sets the loco/invert from the specified stash

IF ( vpin ) … ELSE … ENDIF  - Execute commands if the conditions are met

IFNOT ( vpin ) … ELSE … ENDIF  - Execute commands if the conditions are NOT met

ELSE - Alternate logic to any IF related command returning False

AFTER( vpin [,debounce_time] ) - Halt command execution until the sensor is cleared

HAL( device, parameters ) - Create a HAL device in myAutomation.h

HAL_IGNORE_DEFAULTS - Disable default MCP23017 and PCA9685 HAL devices

SIGNAL( red_pin, amber_pin, green_pin ) - Define a pin based signal

SIGNALH( red_pin, amber_pin, green_pin ) - Define a pin based signal with active high pins

SERVO_SIGNAL( vpin, red_pos, amber_pos, green_pos ) - Define a servo based signal

DCC_SIGNAL( id, addr, sub_addr ) - Define a DCC accessory signal

DCCX_SIGNAL( Address, redAspect, amberAspect, greenAspect ) - Defines a signal (with id as dcc address)

ASPECT( address, aspect ) - Command for DCC Extended Accessories

ONGREEN( signal_id) - Define event handler for when a signal is set to the green

ONAMBER( signal_id) - Define event handler for when a signal is set to the amber

ONRED( signal_id) - Define event handler for when a signal is set to the red aspect

TURNOUT( turnout_id, addr, sub_addr [, "description"]|HIDDEN ) - Define a DCC accessory turnout/point

TURNOUTL( turnout_id, addr [, "description"]|HIDDEN ) - Define a DCC accessory turnout/point

PIN_TURNOUT( turnout_id, pin [, "description"]|HIDDEN ) - Define a pin operated turnout

SERVO_TURNOUT( turnout_id, pin, active_angle, inactive_angle, profile [, "description"]|HIDDEN ) - Define a servo turnout/point

VIRTUAL_TURNOUT( turnout_id [, "description"]|HIDDEN ) - Define a virtual turnout, which is backed by another automation sequence

ONCLOSE( turnout_id ) - Event handler for when a turnout/point is closed

ONTHROW( turnout_id ) - Event handler for when a turnout/point is thrown

TOGGLE_TURNOUT( turnout_id ) - Toggle a defined turnout/point between CLOSE/THROW

MOVETT( id, steps, activity ) - Move a  to a step position and perform an activity

IFRE ( vpin, value ) - Test if a rotary encoder has been set to a value

ONCHANGE( vpin ) - Detects a rotary encoder has changed position

DCC_TURNTABLE( id, home_angle, [, "description"] ) - Define a DCC accessory turntable/traverser

EXTT_TURNTABLE( id, vpin, home_angle, [, "description"] ) - Define an EX-Turntable turntable/traverser

TT_ADDPOSITION( id, position_id, value, angle [, "description"] ) - Add a turntable position

IFTTPOSITION( id, position ) - Test if turntable/traverser is at a position

ONROTATE( id ) - Event handler for when a turntable/traverser is rotated

ROTATE( id, position, activity ) - Rotate an EX-Turntable turntable/traverser

ROTATE_DCC( id, position ) - Rotate a DCC accessory turntable/traverser

WAITFORTT( id ) - Wait for EX-Turntable turntable/traverser to complete a rotation

JMRI_SENSOR(vpin [,count]) - Creates <S> type sensors visible to JMRI

ATTIMEOUT( vpin, timeout_ms ) - Causes a sequence to wait until either a sensor is active/triggered, or if the timer runs out

IFTIMEOUT - Tests if “timed out” flag has been set by an ATTIMEOUT() sensor reading attempt

ATLT ( vpin, value ) - Waits for an analog pin to go below a value

IFGTE( vpin, value ) - Test if analog pin reading is greater than or equal to value

IFLT( vpin, value ) - Test if analog pin reading is less than value

CONFIGURE_SERVO(vpin, pos1, pos2, profile) - Define LED’s connected to PCA9685 boards

NEOPIXEL( vpin, red, green, blue [,count] ) - Controls the colour of attached Neopixel LEDs

NEOPIXEL_SIGNAL( signalid, red, green, blue ) - Controls the colour of attached Neopixel LED

PLAYSOUND( vpin, fileNumber, volume ) - Play mp3 files from a Micro-SD card

SERVO2( id, position, duration ) - Move an animation servo taking duration

WAITFOR( pin ) - Wait for a servo motion to complete prior to continuing

ONACTIVATE( addr, sub_addr ) - Event handler for 2 part DCC accessory packet value 1

ONACTIVATEL( linear ) - Event handler for linear DCC accessory packet value 1

ONDEACTIVATE( addr, sub_addr ) - Event handler for 2 part DCC accessory packet value 0

ONDEACTIVATEL( linear ) - Event handler for linear DCC accessory packet value 0

ACTIVATE( addr, sub_addr ) - Sends a DCC accessory packet with value 1

ACTIVATEL( linear ) - Sends a DCC accessory packet with value 1 to a linear address

DEACTIVATE( addr, sub_addr ) - Sends a DCC accessory packet with value 0

DEACTIVATEL( addr ) - Sends a DCC accessory packet with value 0 to a linear address

ONTIME( value ) - Event handler for when the specified time is reached

ONCLOCKTIME( hours, mins ) - Event handler for when the specified clock time is reached

ONCLOCKMINS( mins ) - Event handler to be repeated the same time every hour

SENDLOCO( loco, route ) - Start route/sequence with a specified loco

ROSTER( loco, "name", "func_map" ) - Provide roster info for a specified loco

IFLOCO( loco ) - perform commands if the specified loco ID is defined for this sequence

AFTEROVERLOAD( track ) - Event handler for when an Overload clears

IFRESERVE( block_id ) - Execute commands if block is NOT reserved

BROADCAST( "msg" ) - Broadcast to all throttles/JMRI on serial and WiFi

PARSE( "msg" ) - Allows parsing of a DCC-EX API command via myAutomation.h

IO_NO_HAL - Reduce FLASH footprint when HAL features not required

exrail/exrail-command-reference:correct use of done, endif, and follow() statements

exrail/exrail-command-reference:at(vpin) or after(vpin [,debouncetime]) versus if(vpin)

exrail/exrail-command-reference:interactive diagnostics and control

exrail/exrail-command-reference:``<d exrail state>`` - enable or disable exrail sequence logging

exrail/exrail-command-reference:``</pause>`` - pause all exrail automation activities

exrail/exrail-command-reference:``</resume>`` - resume **all** exrail automation activities

exrail/exrail-command-reference:``</>`` - display exrail running task information

exrail/exrail-command-reference:``</ start [loco_addr] route_id>`` - start route, optionally using specified loco

</ START [loco_addr] route_id> - Start route, optionally using specified loco

exrail/exrail-command-reference:``</ kill task_id>`` - kills a currently running process

exrail/exrail-command-reference:``</ reserve block_id>`` - manually reserves a virtual track block

exrail/exrail-command-reference:``</ free block_id>`` - manually frees a virtual track block

exrail/exrail-command-reference:``</ latch vpin>`` - lock sensor on, preventing external influence

exrail/exrail-command-reference:``</ unlatch vpin>`` - unlock sensor, returning to current external state

</ UNLATCH vpin> - Unlock sensor, returning to current external state

exrail/exrail-command-reference:``alias( name[, value] )`` - assigns name to a value

exrail/exrail-command-reference:scripts/sequences - types and control

exrail/exrail-command-reference:``autostart`` - automatically start sequence at this point during ex-commandstation startup

exrail/exrail-command-reference:``automation( id, "description" )`` - define an automation, advertised to throttles/clients

exrail/exrail-command-reference:``route( id, "description" )`` - define a route, advertised to throttles/clients

exrail/exrail-command-reference:``sequence( id )`` - a general purpose sequence, not advertised to throttles/clients

exrail/exrail-command-reference:``done`` - completes a sequence/route/animation/event, or any other automation

exrail/exrail-command-reference:``endtask`` - completes a sequence/route/animation/event, or any other automation

exrail/exrail-command-reference:``call( id )`` - branch to a separate sequence

exrail/exrail-command-reference:``return`` - return to the calling sequence when completed

exrail/exrail-command-reference:``follow( sequence_id )`` - branch or follow a specified sequence

exrail/exrail-command-reference:``pause`` - e-stop all locos and pause all other exrail tasks

exrail/exrail-command-reference:``resume`` - resume all paused tasks, including loco movement

exrail/exrail-command-reference:``start( id )`` - execute a route or sequence

exrail/exrail-command-reference:``delay( delay )`` - delay the sequence a number of milliseconds

exrail/exrail-command-reference:``delayms( delay )`` - delay the sequence a number of milliseconds

exrail/exrail-command-reference:``delaymins( delay )`` - delay the sequence a number of minutes

exrail/exrail-command-reference:``delayrandom( min_delay, max_delay )`` - delay a random period of time

exrail/exrail-command-reference:``ifrandom( percent )`` - run commands a random percentage of the time

exrail/exrail-command-reference:``route_caption( route_id, "caption" )`` - change the label of the route button

exrail/exrail-command-reference:``route_active( route_id )`` - activate a route

exrail/exrail-command-reference:``route_inactive( route_id, caption )`` - deactivate a route

exrail/exrail-command-reference:``route_hidden( route_id )`` - hide a route from display

exrail/exrail-command-reference:``route_disabled( route_id )`` - disable a route

exrail/exrail-command-reference:``stash( stash_id )`` - stashes the current loco/invert

exrail/exrail-command-reference:``clear_stash( stash_id )`` - zeroes the specified stash

exrail/exrail-command-reference:``clear_all_stash`` - zeroes all stashes

exrail/exrail-command-reference:``pickup_stash( stash_id )`` - retrieves and sets the loco/invert from the specified stash

exrail/exrail-command-reference:``if ( vpin )`` ... else ... endif - execute commands if the conditions are met

exrail/exrail-command-reference:``ifnot ( vpin )`` ... else ... endif - execute commands if the conditions are not met

exrail/exrail-command-reference:``else`` - alternate logic to any if related command returning false

exrail/exrail-command-reference:``endif`` - required to end an if/ifnot/etc.

exrail/exrail-command-reference:``at( vpin )`` - halt command execution until the sensor is set

exrail/exrail-command-reference:``after( vpin [,debounce_time] )`` - halt command execution until the sensor is cleared

exrail/exrail-command-reference:objects - definition and control

exrail/exrail-command-reference:create and manage hal device objects

exrail/exrail-command-reference:``hal( device, parameters )`` - create a hal device in myautomation.h

exrail/exrail-command-reference:``hal_ignore_defaults`` - disable default mcp23017 and pca9685 hal devices

exrail/exrail-command-reference:signal objects - definition and control

exrail/exrail-command-reference:``signal( red_pin, amber_pin, green_pin )`` - define a pin based signal

exrail/exrail-command-reference:``signalh( red_pin, amber_pin, green_pin )`` - define a pin based signal with active high pins

exrail/exrail-command-reference:``servo_signal( vpin, red_pos, amber_pos, green_pos )`` - define a servo based signal

exrail/exrail-command-reference:``dcc_signal( id, addr, sub_addr )`` - define a dcc accessory signal

exrail/exrail-command-reference:``dccx_signal( address, redaspect, amberaspect, greenaspect )`` - defines a signal (with id as dcc address)

exrail/exrail-command-reference:``virtual_signal( id )`` - define a virtual signal

exrail/exrail-command-reference:``ifred( signal_id )`` - test if signal is red

exrail/exrail-command-reference:``ifamber( signal_id )`` - test if signal is amber

exrail/exrail-command-reference:``ifgreen( signal_id )`` - test if signal is green

exrail/exrail-command-reference:``green( signal_id )`` - set a defined signal to green

exrail/exrail-command-reference:``amber( signal_id )`` - set a defined signal to amber

exrail/exrail-command-reference:``red( signal_id )`` - set defined signal to red

exrail/exrail-command-reference:``aspect( address, aspect )`` - command for dcc extended accessories

exrail/exrail-command-reference:``ongreen( signal_id)`` - define event handler for when a signal is set to the green

exrail/exrail-command-reference:``onamber( signal_id)`` - define event handler for when a signal is set to the amber

exrail/exrail-command-reference:``onred( signal_id)`` - define event handler for when a signal is set to the red aspect

exrail/exrail-command-reference:turnout/point objects - definition and control

exrail/exrail-command-reference:``turnout( turnout_id, addr, sub_addr [, "description"]|hidden )`` - define a dcc accessory turnout/point

exrail/exrail-command-reference:``turnoutl( turnout_id, addr [, "description"]|hidden )`` - define a dcc accessory turnout/point

exrail/exrail-command-reference:``pin_turnout( turnout_id, pin [, "description"]|hidden )`` - define a pin operated turnout

exrail/exrail-command-reference:``servo_turnout( turnout_id, pin, active_angle, inactive_angle, profile [, "description"]|hidden )`` - define a servo turnout/point

exrail/exrail-command-reference:``virtual_turnout( turnout_id [, "description"]|hidden )`` - define a virtual turnout, which is backed by another automation sequence

exrail/exrail-command-reference:``ifclosed( turnout_id )`` - test if a turnout/point is closed

exrail/exrail-command-reference:``ifthrown( turnout_id )`` - test if a turnout/point is thrown

exrail/exrail-command-reference:``onclose( turnout_id )`` - event handler for when a turnout/point is closed

exrail/exrail-command-reference:``onthrow( turnout_id )`` - event handler for when a turnout/point is thrown

exrail/exrail-command-reference:``close( turnout_id )`` - close a turnout/point

exrail/exrail-command-reference:``throw( turnout_id )`` - throw a turnout/point

exrail/exrail-command-reference:``toggle_turnout( turnout_id )`` - toggle a defined turnout/point between close/throw

exrail/exrail-command-reference:turntable/traverser objects - definition and control

exrail/exrail-command-reference:``movett( id, steps, activity )`` - move a |ex-tt| to a step position and perform an activity

exrail/exrail-command-reference:``ifre ( vpin, value )`` - test if a rotary encoder has been set to a value

exrail/exrail-command-reference:``onchange( vpin )`` - detects a rotary encoder has changed position

exrail/exrail-command-reference:``dcc_turntable( id, home_angle, [, "description"] )`` - define a dcc accessory turntable/traverser

exrail/exrail-command-reference:``extt_turntable( id, vpin, home_angle, [, "description"] )`` - define an ex-turntable turntable/traverser

exrail/exrail-command-reference:``tt_addposition( id, position_id, value, angle [, "description"] )`` - add a turntable position

exrail/exrail-command-reference:``ifttposition( id, position )`` - test if turntable/traverser is at a position

exrail/exrail-command-reference:``onrotate( id )`` - event handler for when a turntable/traverser is rotated

exrail/exrail-command-reference:``rotate( id, position, activity )`` - rotate an ex-turntable turntable/traverser

exrail/exrail-command-reference:``rotate_dcc( id, position )`` - rotate a dcc accessory turntable/traverser

exrail/exrail-command-reference:``waitfortt( id )`` - wait for ex-turntable turntable/traverser to complete a rotation

exrail/exrail-command-reference:sensors/inputs - reading and responding

exrail/exrail-command-reference:``jmri_sensor(vpin [,count])`` - creates <s> type sensors visible to jmri

exrail/exrail-command-reference:``at( vpin )`` - causes a sequence to wait until a sensor is active/triggered

AT( vpin ) - Causes a sequence to wait until a sensor is active/triggered

exrail/exrail-command-reference:``after( vpin )`` - causes a sequence to wait until after a sensor has been triggered

AFTER( vpin ) - Causes a sequence to wait until after a sensor has been triggered

exrail/exrail-command-reference:``attimeout( vpin, timeout_ms )`` - causes a sequence to wait until either a sensor is active/triggered, or if the timer runs out

exrail/exrail-command-reference:``if( vpin )`` - if sensor activated or latched, continue

exrail/exrail-command-reference:``ifnot( vpin )`` - if sensor not activated and not latched, continue

IFNOT( vpin ) - If sensor NOT activated and NOT latched, continue

exrail/exrail-command-reference:``iftimeout`` - tests if "timed out" flag has been set by an attimeout() sensor reading attempt

exrail/exrail-command-reference:``atgte( vpin, value )`` - waits for an analog pin to reach a value

exrail/exrail-command-reference:``atlt ( vpin, value )`` - waits for an analog pin to go below a value

exrail/exrail-command-reference:``ifgte( vpin, value )`` - test if analog pin reading is greater than or equal to value

exrail/exrail-command-reference:``iflt( vpin, value )`` - test if analog pin reading is less than value

exrail/exrail-command-reference:``attimout1 ( vpin, value )`` - tba

exrail/exrail-command-reference:``attimout2 ( vpin, value )`` - tba

exrail/exrail-command-reference:``latch( vpin )`` - latches a sensor on

exrail/exrail-command-reference:``unlatch( vpin )`` - remove latch on sensor

exrail/exrail-command-reference:``onbutton( vpin )`` - event handler for debounced button presses

exrail/exrail-command-reference:``onsensor( vpin )`` - event handler for sensors

exrail/exrail-command-reference:``set( vpin [,count] )`` - set an output pin high

exrail/exrail-command-reference:``reset( vpin [,count] )`` - reset output pin

exrail/exrail-command-reference:``fade( vpin, value, ms )`` - fade an led

exrail/exrail-command-reference:``blink( vpin, onms, offms )`` - blink an output pin

exrail/exrail-command-reference:``lcn( "msg" )`` - send message to lcn accessory network

exrail/exrail-command-reference:``configure_servo(vpin, pos1, pos2, profile)`` - define led's connected to pca9685 boards

exrail/exrail-command-reference:``neopixel( vpin, red, green, blue [,count] )`` - controls the colour of attached neopixel leds

exrail/exrail-command-reference:``neopixel_signal( signalid, red, green, blue )`` - controls the colour of attached neopixel led

exrail/exrail-command-reference:``anout( vpin, value, param1, param2)`` - analog output ??

exrail/exrail-command-reference:``playsound( vpin, filenumber, volume )`` - play mp3 files from a micro-sd card

exrail/exrail-command-reference:``servo( id, position, profile )`` - move an animation servo

exrail/exrail-command-reference:``servo2( id, position, duration )`` - move an animation servo taking duration

exrail/exrail-command-reference:``waitfor( pin )`` - wait for a servo motion to complete prior to continuing

exrail/exrail-command-reference:``onactivate( addr, sub_addr )`` - event handler for 2 part dcc accessory packet value 1

exrail/exrail-command-reference:``onactivatel( linear )`` - event handler for linear dcc accessory packet value 1

exrail/exrail-command-reference:``ondeactivate( addr, sub_addr )`` - event handler for 2 part dcc accessory packet value 0

exrail/exrail-command-reference:``ondeactivatel( linear )`` - event handler for linear dcc accessory packet value 0

exrail/exrail-command-reference:``activate( addr, sub_addr )`` - sends a dcc accessory packet with value 1

exrail/exrail-command-reference:``activatel( linear )`` - sends a dcc accessory packet with value 1 to a linear address

exrail/exrail-command-reference:``deactivate( addr, sub_addr )`` - sends a dcc accessory packet with value 0

exrail/exrail-command-reference:``deactivatel( addr )`` - sends a dcc accessory packet with value 0 to a linear address

exrail/exrail-command-reference:``dccactivate( addr, sub_addr )`` - tba

exrail/exrail-command-reference:``xfon( cab, func )``` - send dcc function on to specific cab

exrail/exrail-command-reference:``xfoff( cab, func )`` - send dcc function off to specific cab

exrail/exrail-command-reference:``xftoggle( loco, func )`` - toggle dcc function on specific loco

exrail/exrail-command-reference:``ontime( value )`` - event handler for when the specified time is reached

exrail/exrail-command-reference:``onclocktime( hours, mins )`` - event handler for when the specified clock time is reached

exrail/exrail-command-reference:``onclockmins( mins )`` - event handler to be repeated the same time every hour

exrail/exrail-command-reference:``estop`` - emergency stops all locomotives

exrail/exrail-command-reference:``setloco( loco )`` - set the loco address for this task

exrail/exrail-command-reference:``sendloco( loco, route )`` - start route/sequence with a specified loco

exrail/exrail-command-reference:``read_loco`` - read loco id from prog track

exrail/exrail-command-reference:``fwd( speed )`` - drive loco forward at dcc speed

exrail/exrail-command-reference:``rev( speed )`` - drive loco in reverse at dcc speed

exrail/exrail-command-reference:``speed( speed )`` - drive loco in current direction at dcc speed

exrail/exrail-command-reference:``fon( func )`` - turn on loco function

exrail/exrail-command-reference:``foff( func )`` - turn off loco function

exrail/exrail-command-reference:``ftoggle( func )`` - toggle the state of a loco's function

exrail/exrail-command-reference:``invert_direction`` - switches fwd/rev meaning for loco

exrail/exrail-command-reference:``roster( loco, "name", "func_map" )`` - provide roster info for a specified loco

exrail/exrail-command-reference:``pom( cv, value )`` - program cv value on main

exrail/exrail-command-reference:``ifloco( loco )`` - perform commands if the specified loco id is defined for this sequence

exrail/exrail-command-reference:``forget`` - forget the loco in the running automation/sequence

exrail/exrail-command-reference:``set_track( track, mode )`` - configures the mode of a track

exrail/exrail-command-reference:``set_power( track, on/off )`` - enable/disable power on a track

exrail/exrail-command-reference:``setfreq( track, frequency )`` - enable a specific frequency

exrail/exrail-command-reference:``onoverload( track )`` - event handler for when an overload occurs

exrail/exrail-command-reference:``afteroverload( track )`` - event handler for when an overload clears

exrail/exrail-command-reference:``reserve( block_id )`` - reserve a block

exrail/exrail-command-reference:``free( block_id )`` - free block

exrail/exrail-command-reference:``ifreserve( block_id )`` - execute commands if block is not reserved

exrail/exrail-command-reference:communication and display functions

exrail/exrail-command-reference:``lcd( row, "msg" )`` - write message on lcd/oled

exrail/exrail-command-reference:``screen( display, row, "msg" )`` - writes a message to a display

exrail/exrail-command-reference:``broadcast( "msg" )`` - broadcast to all throttles/jmri on serial and wifi

exrail/exrail-command-reference:``print( "msg" )`` - print diagnostic message to serial monitor

exrail/exrail-command-reference:``serial( "msg" )`` - writes direct to serial

exrail/exrail-command-reference:``serial1( "msg" )`` - writes direct to serial1

exrail/exrail-command-reference:``serial2( "msg" )`` - writes direct to serial2

exrail/exrail-command-reference:``serial3( "msg" )`` - writes direct to serial3

exrail/exrail-command-reference:``serial4( "msg" )`` - writes direct to serial4

exrail/exrail-command-reference:``serial5( "msg" )`` - writes direct to serial5

exrail/exrail-command-reference:``serial6( "msg" )`` - writes direct to serial6

exrail/exrail-command-reference:``withrottle( "msg" )`` - writes a message to withrottle clients

exrail/exrail-command-reference:``message( "msg" )`` - writes a message to all clients

exrail/exrail-command-reference:``poweron`` - power on track and unjoin

exrail/exrail-command-reference:``join`` - join prog and main track outputs

exrail/exrail-command-reference:``unjoin`` - disconnect prog track from main

exrail/exrail-command-reference:``endexrail`` - deprecated - do not use

exrail/exrail-command-reference:``exrail`` - deprecated - do not use

exrail/exrail-command-reference:``killall`` - kills all running |ex-r| activities

exrail/exrail-command-reference:``parse( "msg" )`` - allows parsing of a dcc-ex api command via myautomation.h

exrail/exrail-command-reference:``disable_prog`` - disable programming to save ram/flash

exrail/exrail-command-reference:``io_no_hal`` - reduce flash footprint when hal features not required

exrail/exrail-command-reference:``onlcc(sender, eventid)`` - tba

exrail/exrail-command-reference:``lccx(senderid,eventid)`` - tba

exrail/exrail-command-reference:``stealth( code )`` - include some c++ code in a route/sequence

exrail/getting-started:automatically running a sequence at power up

exrail/getting-started:action commands - getting exrail to 'do' something

exrail/index:exrail |br| |small-start| automation & animation |small-end|

exrail/overview:reasons to use exrail rather than extra software and/or hardware

external-references/standards:national model railroad association (nmra)

news/posts/20230309:extra, extra, read all about it! introducing dcc-ex news!

news/posts/20230327:version 5 progress and a breaking change in the development branch

news/posts/20230807:ex-commandstation features, fixes, and enhancements

news/posts/20230911:farewell to the old exinstaller, in with the new ex-installer!

news/posts/20231207:announcing the new dccexprotocol arduino library!

news/posts/20240214:belated happy new year and a new ex-installer!

news/posts/20240215:announcing ex-sensorcam - a new camera-based sensor for your layout

news/posts/20240911:how do i display track current on the display?

news/posts/20241220:dcc-ex releases ex-csb1 ready to run dcc commandstation

news/posts/20241220:in the united states serving usa, canada, \& mexico

news/posts/20250128:if you have an issue uploading to an ex-csb1

projects/prominiair_transmitter_w_commandstation:battery power, radio control: prominiair transmitter integrated with a wifi-equipped |ex-cs| (pma tx/wcs)

Battery Power, Radio Control: ProMiniAir Transmitter Integrated with a WiFi-equipped  (PMA Tx/WCS)

projects/railsnail-bluetooth:railsnail's complete bluetooth ex-commandstation

purchasing/become-a-dealer:ordering in quantity or becoming an official reseller

purchasing/dealers:in the united states serving usa, canada, \& mexico

purchasing/include__dealers:in the united states serving usa, canada, \& mexico

purchasing/include__dealers:in austria serving the european union (eu)

purchasing/include__dealers:in australia serving au, nz, and apac

reference/accessories/suppliers-cases:command station rack (the mac rack)

reference/accessories/suppliers-cases:sumner's mega dual configuration case (3d print)

reference/accessories/suppliers-cases:hans tanner's iott cube case system (3d print)

reference/accessories/suppliers-cases:nebbish's arduino mega case for dcc-ex (3d print)

reference/accessories/suppliers-full-cs:cmme (chesterfield model making & miniature electronics)

reference/developers/api:2. serial port and wifi/ethernet monitoring

reference/developers/api:3. general api command usage and responses

reference/developers/api:appendix b. suggested parameter parsing sequence

reference/developers/api:c.1. keyword parameters are not case sensitive

reference/developers/hal-config:identifying what devices are connected

reference/developers/hal-config:notes on the pca9555/tca9555 i2c gpio extenders

reference/developers/hal-config:adding a new device configuration file

reference/developers/hal-config:adding in the configuration commands

reference/developers/hal-config:upload the new version of the software

reference/downloads/documents:java model railroad interface jmri with ex-commandstation

reference/downloads/documents:jmri jython.py script to add custom dcc-ex buttons to decoderpro & panelpro menus

reference/downloads/documents:how to; create dcc-ex buttons on jmri main menus (pdf)

reference/downloads/documents:comprehensive dcc-ex & jmri decoderpro getting started guide pdf

reference/downloads/documents:stationary decoder address table (xlsx spreadsheet)

reference/hardware/bluetooth/esp32-bluetooth:using bluetooth with your esp32 ex-commandstation

reference/hardware/bluetooth/hc-05-06:hc-05/06 bluetooth modules

reference/hardware/bluetooth/hc-05-06:interactive programming sketch

reference/hardware/bluetooth/hc-05-06:connecting a hc-05/06 to your ex-commandstation

reference/hardware/bluetooth/hc-05-06:bonus material - how to pair a hc-05 with another hc-05/06

reference/hardware/bluetooth/hc-05-06:configure the master hc-05

reference/hardware/dcc-vs-dc:managing dcc and dc modes in trackmanager

reference/hardware/dcc-vs-dc:trackmanager dcc(pwm) vs. dc(pwm) wave forms

reference/hardware/dcc-vs-dc:replacing or integrating into your current layout

reference/hardware/dcc-vs-dc:hardware requirements and technical notes

reference/hardware/ethernet-boards/arduino-ethernet-shield-2:arduino ethernet shield 2

reference/hardware/ethernet-boards/nano-ethernet-shield:nano ethernet shield

reference/hardware/i2c-devices:extending addressing with multiplexer support

reference/hardware/i2c-displays:soldering on the backpack (if you purchased separate pieces)

reference/hardware/i2c-displays:connecting to your ex-commandstation

reference/hardware/i2c-displays:reconfigure your command station to use a single display

reference/hardware/i2c-displays:combine ip address and port on oled

reference/hardware/i2c-multiplexers:which multiplexers are supported?

reference/hardware/i2c-multiplexers:multiplexer i2c base addresses

reference/hardware/i2c-multiplexers:locating devices on i2c buses and multiplexer sub buses

reference/hardware/microcontroller-boards:current list of microcontrollers

reference/hardware/microcontroller-boards:choosing a microcontroller

reference/hardware/microcontroller-boards:will you support other microcontrollers in the future?

reference/hardware/microcontroller-boards:notes on 3v3 vs 5v microcontrollers

reference/hardware/microcontroller-boards:boards that will not work

reference/hardware/microcontrollers/arduino-mega:arduino mega (recommended)

reference/hardware/microcontrollers/arduino-mega:why do we recommend the mega?

reference/hardware/microcontrollers/arduino-mega:arduino pro mini

reference/hardware/microcontrollers/arduino-mega:notes for setting up the arduino pro mini

reference/hardware/microcontrollers/arduino-uno:arduino uno (not recommended)

reference/hardware/microcontrollers/esp32:espressif esp32 series

reference/hardware/microcontrollers/esp32:esp32-wroom-32 boards tested

reference/hardware/microcontrollers/esp32:wemos d1 r32/espduino-32 board

reference/hardware/microcontrollers/esp32:hardware setup notes for a wemos d1 r32/espduino-32 |ex-cs|

reference/hardware/microcontrollers/esp32:using an arduino motor shield r3

reference/hardware/microcontrollers/esp32:additional information on the use of l298 clone motor shields

reference/hardware/microcontrollers/esp32:using a |dcc-ex| ex-motorshield8874

reference/hardware/microcontrollers/esp32:wemos d1 r32/espduino-32 with microsoft windows - ch340 drivers

reference/hardware/microcontrollers/esp32:building dcc-ex for esp32

reference/hardware/microcontrollers/esp32:adding esp32 support to vs code and platformio

reference/hardware/microcontrollers/esp32:adding esp32 support to the arduino ide

reference/hardware/microcontrollers/microcontrollers:beta microcontrollers - stm32 nucleo, esp32, and samd

reference/hardware/microcontrollers/microcontrollers:newer, faster, better

reference/hardware/microcontrollers/microcontrollers:considerations for new microcontrollers

reference/hardware/microcontrollers/microcontrollers:notes on 3v3 vs. 5v microcontrollers

reference/hardware/microcontrollers/microcontrollers:stmicroelectronics stm32 nucleo series

reference/hardware/microcontrollers/microcontrollers:nucleo-f412zg, nucleo-f446ze and nucleo-f429zi

reference/hardware/microcontrollers/microcontrollers:install the stlink drivers for windows

reference/hardware/microcontrollers/microcontrollers:upgrade the debugger firmware

reference/hardware/microcontrollers/microcontrollers:adding nucleo support to the arduino ide

reference/hardware/microcontrollers/microcontrollers:adding nucleo support to vs code/platformio

reference/hardware/microcontrollers/microcontrollers:hardware setup notes for a nucleo |ex-cs|

reference/hardware/microcontrollers/microcontrollers:notes on the arduino connectors on the nucleo range

reference/hardware/microcontrollers/microcontrollers:notes on using the ex-motorshield8874 with nucleo

reference/hardware/microcontrollers/microcontrollers:serial for wifi, for f411re and f446re

reference/hardware/microcontrollers/microcontrollers:espressif esp32 series

reference/hardware/microcontrollers/microcontrollers:wemos d1 r32/espduino-32 board

reference/hardware/microcontrollers/microcontrollers:hardware setup notes for a wemos d1 r32/espduino-32 |ex-cs|

reference/hardware/microcontrollers/microcontrollers:using an arduino motor shield r3

reference/hardware/microcontrollers/microcontrollers:using a |dcc-ex| ex-motorshield8874

reference/hardware/microcontrollers/microcontrollers:wemos d1 r32/espduino-32 with microsoft windows - ch340 drivers

reference/hardware/microcontrollers/microcontrollers:adding esp32 support to the arduino ide

reference/hardware/microcontrollers/microcontrollers:microchip samd21 series

reference/hardware/microcontrollers/microcontrollers:samd21g18 boards tested

reference/hardware/microcontrollers/microcontrollers:dropped character on usb cdc fix

reference/hardware/microcontrollers/nano:arduino nano (not recommended)

reference/hardware/microcontrollers/nano:using the special nano motor shield

reference/hardware/microcontrollers/nano:wiring other motor boards

reference/hardware/microcontrollers/nano-every:nano every (deprecated)

reference/hardware/microcontrollers/stm32-nucleo:stmicroelectronics stm32 nucleo series

reference/hardware/microcontrollers/stm32-nucleo:nucleo-64 vs nucleo-144 form factors

reference/hardware/microcontrollers/stm32-nucleo:choosing a nucleo

reference/hardware/microcontrollers/stm32-nucleo:install the stlink drivers for windows

reference/hardware/microcontrollers/stm32-nucleo:upgrade the debugger firmware

reference/hardware/microcontrollers/stm32-nucleo:upgrade the debugger firmware in windows

reference/hardware/microcontrollers/stm32-nucleo:adding nucleo support to the arduino ide

reference/hardware/microcontrollers/stm32-nucleo:adding nucleo support to vs code/platformio

reference/hardware/microcontrollers/stm32-nucleo:hardware setup notes for a nucleo-64 based ex-commandstation

reference/hardware/microcontrollers/stm32-nucleo:notes on the arduino connectors on the nucleo-64 range

reference/hardware/microcontrollers/stm32-nucleo:serial for wifi, for nucleo-64 models

reference/hardware/microcontrollers/stm32-nucleo:hardware setup notes for a nucleo-144 based ex-commandstation

reference/hardware/microcontrollers/stm32-nucleo:notes on the arduino connectors on the nucleo-144 range

reference/hardware/microcontrollers/stm32-nucleo:serial for wifi, for nucleo-144 models

reference/hardware/microcontrollers/stm32-nucleo:notes on using the ex-motorshield8874 with nucleo

reference/hardware/microcontrollers/teensy:teensy 3.6 specifications

reference/hardware/microcontrollers/wifi-mega:mega+wifi (not recommended)

reference/hardware/microcontrollers/wifi-mega:what you will need

reference/hardware/microcontrollers/wifi-mega:1. flashing the esp8266 chip

reference/hardware/microcontrollers/wifi-mega:a. plug in and test your mega

reference/hardware/microcontrollers/wifi-mega:b. download and install the flash download tool

reference/hardware/microcontrollers/wifi-mega:using the flash download tool (windows)

reference/hardware/microcontrollers/wifi-mega:using esptool.py (windows, mac, linux)

reference/hardware/microcontrollers/wifi-mega:c. set the switches on your mega for flashing

reference/hardware/microcontrollers/wifi-mega:d. flash the firmware

reference/hardware/microcontrollers/wifi-mega:with the flash download tool

reference/hardware/microcontrollers/wifi-mega:run the flasher tool

reference/hardware/microcontrollers/wifi-mega:setup the files and memory locations in the flasher tool

reference/hardware/microcontrollers/wifi-mega:e. set the switches for run/sketch mode

reference/hardware/microcontrollers/wifi-mega:2. decide if you want access point mode or station mode

reference/hardware/microcontrollers/wifi-mega:3. configure the ex-commandstation software

reference/hardware/microcontrollers/wifi-mega:short version of network setup

reference/hardware/microcontrollers/wifi-mega:long version of network setup

reference/hardware/microcontrollers/wifi-mega:setting up in access point (ap) mode

reference/hardware/microcontrollers/wifi-mega:setting up wifi in station (sta) mode with router

reference/hardware/microcontrollers/wifi-mega:4. compile and re-upload ex-commandstation software to the arduino

reference/hardware/microcontrollers/wifi-mega:5. operate your ex-commandstation

reference/hardware/microcontrollers/wifi-mega:6. connect your phone as a throttle (controller)

reference/hardware/motor-boards:trackmanager dc compatible boards

reference/hardware/motorboards/ibt_2-motor-board-setup:ibt_2 bts7960 motor board

reference/hardware/motorboards/ibt_2-motor-board-setup:what you will need (ibt_2)

reference/hardware/motorboards/ibt_2-motor-board-setup:which option should you choose? (ibt_2)

reference/hardware/motorboards/ibt_2-motor-board-setup:upgrading (use the arduino motor shield and the ibt_2)

reference/hardware/motorboards/ibt_2-motor-board-setup:what we are going to do (upgrade)

reference/hardware/motorboards/ibt_2-motor-board-setup:replacing (using one ibt_2 for main and another for prog)

reference/hardware/motorboards/ibt_2-motor-board-setup:what we are going to do (replace)

reference/hardware/motorboards/ibt_2-motor-board-setup:important notes on current sensing (ibt_2)

reference/hardware/motorboards/ibt_2-motor-board-setup:modifying your motor board definition to give the correct current sense factor

reference/hardware/motorboards/ibt_2-motor-board-setup:using external current sense

reference/hardware/motorboards/ibt_2-motor-board-setup:parts list (ibt_2)

reference/hardware/motorboards/ibt_2-motor-board-setup:tech notes (ibt_2)

reference/hardware/motorboards/ibt_2-motor-board-setup:motor board definitions (ibt_2)

reference/hardware/motorboards/irf3205-motor-board-setup:irf3205 motor driver setup

reference/hardware/motorboards/irf3205-motor-board-setup:dual motor driver module h-bridge mosfet irf3205

reference/hardware/motorboards/irf3205-motor-board-setup:what you will need (irf3205)

reference/hardware/motorboards/irf3205-motor-board-setup:which option should you choose? (irf3205)

reference/hardware/motorboards/irf3205-motor-board-setup:upgrading (use the arduino motor shield and the irf3205)

reference/hardware/motorboards/irf3205-motor-board-setup:what tinkerers are going to do (upgrade)

reference/hardware/motorboards/irf3205-motor-board-setup:steps (upgrade irf3205)

reference/hardware/motorboards/irf3205-motor-board-setup:replacing (use both irf3205 outputs to control main and prog)

reference/hardware/motorboards/irf3205-motor-board-setup:what tinkerers are going to do (replace irf3205)

reference/hardware/motorboards/irf3205-motor-board-setup:steps (replace irf3205)

reference/hardware/motorboards/irf3205-motor-board-setup:important notes on current sensing

reference/hardware/motorboards/irf3205-motor-board-setup:using other external current sense boards

reference/hardware/motorboards/irf3205-motor-board-setup:sense current at the tracks instead of the motor board input

reference/hardware/motorboards/irf3205-motor-board-setup:tech notes (irf3205)

reference/hardware/motorboards/irf3205-motor-board-setup:motor board definition for irf3205

reference/hardware/motorboards/irf3205-motor-board-setup:irf3205 15a motor board schematic

reference/hardware/motorboards/irf3205-motor-board-setup:keeping your tracks in phase

reference/hardware/motorboards/irf3205-motor-board-setup:parts list (irf3205)

reference/hardware/motorboards/l298n-motor-board-setup:l298n motor driver setup

reference/hardware/motorboards/l298n-motor-board-setup:when is the l298n a good option?

reference/hardware/motorboards/l298n-motor-board-setup:l298n for main and prog with current sense

reference/hardware/motorboards/l298n-motor-board-setup:method 1: adding current sense resistors

reference/hardware/motorboards/l298n-motor-board-setup:lifting or cutting chip legs option

reference/hardware/motorboards/l298n-motor-board-setup:cutting traces and soldering on the back option

reference/hardware/motorboards/l298n-motor-board-setup:configuring the board in ex-commandstation

reference/hardware/motorboards/l298n-motor-board-setup:using 2 signal pins (avoids soldering a transistor inverter)

reference/hardware/motorboards/l298n-motor-board-setup:using one signal pin with an inverter circuit

reference/hardware/motorboards/l298n-motor-board-setup:method 2: using an external current sense board

reference/hardware/motorboards/l298n-motor-board-setup:l298n for prog and high current ibt_2 for main

reference/hardware/motorboards/arduino-motor-shield:arduino motor shield r3

reference/hardware/motorboards/deek-robot-motor-shield:deek-robot motor shield

reference/hardware/motorboards/dfrobot-2x2a-dc-motor-shield:dfrobot 2x2a dc motor shield (dri0009)

reference/hardware/motorboards/dfrobot-romeo-v2:dfrobot romeo v2

reference/hardware/motorboards/diy-more-l298nh-motor-shield:diy more l298nh motor shield

reference/hardware/motorboards/ex-motor-shield-8874:why did we make it?

reference/hardware/motorboards/ex-motor-shield-8874:how can i get one?

reference/hardware/motorboards/ex-motor-shield-8874:suppliers / resellers list

reference/hardware/motorboards/ex-motor-shield-8874:in the united states serving usa, canada, \& mexico

reference/hardware/motorboards/ex-motor-shield-8874:in england serving the uk

reference/hardware/motorboards/ex-motor-shield-8874:in austria serving the european union (eu)

reference/hardware/motorboards/ex-motor-shield-8874:in australia serving au, nz, and apac

reference/hardware/motorboards/ex-motor-shield-8874:1. connect dc power to motor driver

reference/hardware/motorboards/ex-motor-shield-8874:1. turn on power to the motor driver

reference/hardware/motorboards/ex-motor-shield-8874:3. connect track to motor driver

reference/hardware/motorboards/ex-motor-shield-8874:stacking an arduino motor shield r3 and ex-motorshield8874

reference/hardware/motorboards/ex-motor-shield-8874:testing trackmanager configuration and operation

reference/hardware/motorboards/flashtree-motor-shield:flashtree motor shield

reference/hardware/motorboards/high-accuracy:high accuracy waveform mode

reference/hardware/motorboards/high-accuracy:the motor board config

reference/hardware/motorboards/keyes-fundumoto:keyes/fundumoto ("beeper board")

reference/hardware/motorboards/makerfabs-h-bridge-motor-shield:makerfabs h-bridge motor shield

reference/hardware/motorboards/miniibt-motor-driver-l6201p:miniibt motor driver l6201p (single)

reference/hardware/motorboards/motor-board-config:motor driver configuration

reference/hardware/motorboards/motor-board-config:configure using the installer

reference/hardware/motorboards/motor-board-config:configure by editing the config.h file

reference/hardware/motorboards/motor-board-config:if your board is in the supported list

reference/hardware/motorboards/motor-board-config:if your board is not in the supported list

reference/hardware/motorboards/motor-board-config:using high accuracy waveform mode

reference/hardware/motorboards/motor-board-config:current sense and sense factor

reference/hardware/motorboards/motor-board-config:how do i find volts per amp?

reference/hardware/motorboards/motor-board-config:just buy a current sense board instead

reference/hardware/motorboards/motor-board-config:where do i measure the current?

reference/hardware/motorboards/motor-board-config:reading the input to the motor board

reference/hardware/motorboards/motor-board-config:reading the output to the track

reference/hardware/motorboards/velleman-ka03-kit-vma03:velleman ka03 (kit) vma03 (soldered)

reference/hardware/motorboards/yfrobot-l298p:yfrobot l298p motor shield

reference/hardware/pin-vpin-allocations:default pin/vpin allocations and recommendations

reference/hardware/pin-vpin-allocations:mcp23017 digital i/o expander

reference/hardware/pin-vpin-allocations:mcp23008 digital i/o expander

reference/hardware/pin-vpin-allocations:pcf8574 digital i/o expander

reference/hardware/pin-vpin-allocations:pca9685 pwm servo module

reference/hardware/pin-vpin-allocations:ex-ioexpander - digital and analogue i/o expander

reference/hardware/pin-vpin-allocations:vl53l0x time-of-flight sensor

reference/hardware/power-supplies:how many power supplies do i need?

reference/hardware/power-supplies:why does the mega/esp32/nucleo with standard motor driver need two power supplies?

reference/hardware/power-supplies:barrel connector and usb at the same time

reference/hardware/power-supplies:using one power supply with cheap converters to power everything

reference/hardware/power-supplies:4 pack of buck regular converters

reference/hardware/power-supplies:cheap buck converter with display $5

reference/hardware/power-supplies:using diodes to reduce voltage

reference/hardware/servo-module:controlling servos for animations

reference/hardware/servo-module:animation servo with a mimic panel push button

reference/hardware/servo-module:connecting leds and setting intensity

reference/hardware/servo-module:using these for jmri signal heads and signal masts

reference/hardware/servo-module:technical discussion for engineers

reference/hardware/wifi-boards/duinopeak-esp8266:duinopeak esp8266 wifi expansion board

reference/hardware/wifi-boards/duinopeak-esp8266:install the shield

reference/hardware/wifi-boards/esp32-ant-01:esp32_ant-01 breakout and development board (esp32)

reference/hardware/wifi-boards/ex-wifi-shield-8266:dcc-ex ex-wifishield 8266

reference/hardware/wifi-boards/ex-wifi-shield-8266:how can i get one?

reference/hardware/wifi-boards/hc12-bridge:hc-12 wireless bridge

reference/hardware/wifi-boards/makerfabs-esp8266:remove the plastic jumpers

reference/hardware/wifi-boards/makerfabs-esp8266:align the boards

reference/hardware/wifi-boards/makerfabs-esp8266:seat the boards

reference/hardware/wifi-boards/makerfabs-esp8266:install the jumper wires

reference/hardware/wifi-boards/sparkfun-thing-plus:sparkfun thing plus (esp32)

<onOff [track]> - Turn power on or off to the MAIN and PROG tracks

<onOff [track]> - Turn power on or off to the requested TrackManager track

<t cab> - Request a deliberate update on the cab (loco) speed/functions

<J O id> <JO id> - Request details of the specific turntable/traverser

<J P id> <JP id> - Request all position details of the specified turntable/traverser

<s> - Request the DCC-EX version and hardware info, along with listing defined turnouts

<a addr subaddr activate> - Control an Accessory Decoder with Address and Subaddress

<a linear_addr activate> - Control an Accessory Decoder with linear address

</ RED signalId> </ AMBER signalId> </ GREEN signalId> - Control a signal

<+command> - Sends AT+ commands to the WiFi board (ESP8266, ESP32, etc.)

<C WIFI "ssid" "password"> - Connects to an existing WIFI network in STA mode

<b cab cv bit value> - Write Configuration Variable (CV) bit on main track

<w cab cv value> - Write Configuration Variable (CV) on main track

<V cv bit onOff> - Verify/Read bit of Configuration Variable (CV) with guessed value

<V cv value> - Verify/Read of Configuration Variable (CV) with guessed value

<P register hex1 hex2 [hex3 [hex4 [hex5]]]> - Writes a DCC packet to the PROG track

<B cv bit value callbacknum callbacksub> - Deprecated, please use <W cv value> instead

<W cv value callbacknum callbacksub> - Deprecated, please use <w cv value> instead

<R cv callbacknum callbacksub> - Read Configuration variable byte

<M register hex1 hex2 [hex3 [hex4 [hex5]]]> - Write a DCC packet the MAIN track

<T id DCC addr subaddr> - Define turnout/point on a DCC Accessory Decoder with the specified address and subaddress

<T id DCC linearAddr> - Define turnout/point on a DCC Accessory Decoder with the specified linear address

<T id VPIN vpin> - Define turnout/point output on specified vpin

<T id SERVO vpin thrownPos closedPos profile> - Define turnout/point servo (PWM) on specified vpin

<D SERVO vpin value [profile]> - Set servo position to value on pin vpin

<T id addr subaddr> - Define a turnout on a DCC Accessory Decoder with the specified address and subaddress - Legacy command 

<T id vpin activePos inactivePos> - Define a turnout/point servo on specified vpin - Legacy command 

<I id EXTT vpin home> - Define an EX-Turntable turntable/traverser

<I id ADD position value angle> - Add a position to a turntable/traverser

<z vpin> or <z -vpin> - Control an output pin; no setup required

<Z id vpin iflag> - Creates a new output ID, with specified PIN and IFLAG values

<Z id state> - Sets output ID to either INACTIVE or ACTIVE state

<D HAL SHOW> - Shows configured servo board and GPIO extender board config and used pins

reference/software/command-summary-consolidated:dcc-ex native commands summary reference

reference/software/command-summary-consolidated:conventions used on this page

reference/software/command-summary-consolidated:``<onoff [track]>`` - turn power on or off to the main and prog tracks

reference/software/command-summary-consolidated:``<d reset>`` - re-boot the command station

reference/software/command-summary-consolidated:``<j i> <ji>`` - request current values list

reference/software/command-summary-consolidated:``<j g> <jg>`` - request max current list

reference/software/command-summary-consolidated:``<= trackletter mode [cab]>`` - configure track manager

reference/software/command-summary-consolidated:``<=>`` - request the current track manager configuration

reference/software/command-summary-consolidated:``<onoff [track]>`` - turn power on or off to the requested trackmanager track

reference/software/command-summary-consolidated:change frequency on dc or dc_inv/dcx trackmanager track

reference/software/command-summary-consolidated:cab (loco) commands

reference/software/command-summary-consolidated:``<t cab>`` - request a deliberate update on the cab (loco) speed/functions

reference/software/command-summary-consolidated:``<t cab speed dir>`` - set cab (loco) speed

reference/software/command-summary-consolidated:``<!>`` - emergency stop

reference/software/command-summary-consolidated:``<f cab funct state>`` - turn loco decoder functions on or off

reference/software/command-summary-consolidated:``<f cab byte1 [byte2]>`` - decoder functions - legacy command |deprecated|

reference/software/command-summary-consolidated:``<t reg cab speed dir>`` - set cab (loco) speed - legacy command |deprecated|

reference/software/command-summary-consolidated:``<- [cab]>`` - remove one or all locos from reminders

reference/software/command-summary-consolidated:``<d speedsteps>`` - switch between 28 and 128 speed steps

reference/software/command-summary-consolidated:``<j r>`` ``<jr>`` - request the list defined roster entry ids

reference/software/command-summary-consolidated:``<j r id>`` ``<jr id>`` - request details of a specific roster entry

reference/software/command-summary-consolidated:``<t>`` - request a list all defined turnouts/points

reference/software/command-summary-consolidated:``<t id state>`` - throw or close a defined turnout/point

reference/software/command-summary-consolidated:``<j t id>`` ``<jt id>`` - request details of a specific turnout/point

reference/software/command-summary-consolidated:``<j t>`` ``<jt>`` - request the list of defined turnout/point ids

reference/software/command-summary-consolidated:``<i>`` - request a list all defined turntables/traversers

reference/software/command-summary-consolidated:``<i id>`` - request position of the specified turntable/traverser

reference/software/command-summary-consolidated:``<i id position>`` - rotate a dcc turntable

reference/software/command-summary-consolidated:``<i id position activity>`` - rotate ex-turntable

reference/software/command-summary-consolidated:``<j o>`` ``<jo>`` - request the list of defined turntables/traversers

reference/software/command-summary-consolidated:``<j o id>`` ``<jo id>`` - request details of the specific turntable/traverser

reference/software/command-summary-consolidated:``<j p id> <jp id>`` - request all position details of the specified turntable/traverser

reference/software/command-summary-consolidated:``<j a>`` - request a list of automations/routes

reference/software/command-summary-consolidated:``<j a id> <ja id>`` - request information for a route/automation

reference/software/command-summary-consolidated:``<c>``- request current on the track(s)

reference/software/command-summary-consolidated:``<s>`` - request the dcc-ex version and hardware info, along with listing defined turnouts

reference/software/command-summary-consolidated:``<#>`` - request the number of supported cabs(locos)

reference/software/command-summary-consolidated:``<a addr subaddr activate>`` - control an accessory decoder with address and subaddress

reference/software/command-summary-consolidated:``<a linear_addr activate>`` - control an accessory decoder with linear address

reference/software/command-summary-consolidated:``<a address aspect>`` - command for dcc extended accessories.

reference/software/command-summary-consolidated:``<q>`` - lists status of all sensors

reference/software/command-summary-consolidated:``<s>`` - request a list of all defined sensors

reference/software/command-summary-consolidated:``</ red signalid>`` </ amber signalid> </ green signalid> - control a signal

reference/software/command-summary-consolidated:``<+x>`` - force the command station into "wifi connected" mode

reference/software/command-summary-consolidated:``<+command>`` - sends at+ commands to the wifi board (esp8266, esp32, etc.)

reference/software/command-summary-consolidated:``<+>`` - switch to direct communication with wifi at processor

reference/software/command-summary-consolidated:``<c wifi "ssid" "password">`` - connects to an existing wifi network in sta mode

reference/software/command-summary-consolidated:``<jc minutes speed>`` - start the fast clock with a specified time

reference/software/command-summary-consolidated:``<jc>`` - request the fast clock current time

reference/software/command-summary-consolidated:writing configuration variable (cvs)

reference/software/command-summary-consolidated:writing cvs - program on the main

reference/software/command-summary-consolidated:``<b cab cv bit value>`` - write configuration variable (cv) bit on main track

reference/software/command-summary-consolidated:``<w cab cv value>`` - write configuration variable (cv) on main track

reference/software/command-summary-consolidated:reading/writing configuration variables (cvs) - programming track

reference/software/command-summary-consolidated:``<r cv>`` - read configuration variables (cvs)

reference/software/command-summary-consolidated:``<r>`` - read dcc decoder (cab) address

reference/software/command-summary-consolidated:``<v cv bit onoff>`` - verify/read bit of configuration variable (cv) with guessed value

reference/software/command-summary-consolidated:``<v cv value>`` - verify/read of configuration variable (cv) with guessed value

reference/software/command-summary-consolidated:``<b cv bit onoff>`` - write bit to configuration variable (cv)

reference/software/command-summary-consolidated:``<w cv value>`` - write configuration variable (cv)

reference/software/command-summary-consolidated:``<w address>`` - write dcc address to cab (loco)

reference/software/command-summary-consolidated:``<p register hex1 hex2 [hex3 [hex4 [hex5]]]>`` - writes a dcc packet to the prog track

reference/software/command-summary-consolidated:``<b cv bit value callbacknum callbacksub>`` - :dcc-ex-red-bold-italic:`deprecated, please use <w cv value> instead`

reference/software/command-summary-consolidated:``<w cv value callbacknum callbacksub>`` - :dcc-ex-red-bold-italic:`deprecated, please use <w cv value> instead`

reference/software/command-summary-consolidated:``<r cv callbacknum callbacksub>`` - read configuration variable byte

reference/software/command-summary-consolidated:write direct dcc packet

reference/software/command-summary-consolidated:``<m register hex1 hex2 [hex3 [hex4 [hex5]]]>`` - write a dcc packet the main track

reference/software/command-summary-consolidated:programming track - tuning

reference/software/command-summary-consolidated:``<d ack limit ma>`` - sets the ack limit

reference/software/command-summary-consolidated:``<d ack min µs>`` - sets the ack pulse minimum

reference/software/command-summary-consolidated:``<d ack max µs>`` - sets the ack pulse maximum

reference/software/command-summary-consolidated:``<d ack retry num>`` - adjust ack retries

reference/software/command-summary-consolidated:``<d progboost>`` - override prog track limit while idle

reference/software/command-summary-consolidated:turnouts/points (configuring the ex-commandstation)

reference/software/command-summary-consolidated:``<t id dcc addr subaddr>`` - define turnout/point on a dcc accessory decoder with the specified address and subaddress

reference/software/command-summary-consolidated:``<t id dcc linearaddr>`` - define turnout/point on a dcc accessory decoder with the specified linear address

reference/software/command-summary-consolidated:``<t id vpin vpin>`` - define turnout/point output on specified vpin

reference/software/command-summary-consolidated:``<t id servo vpin thrownpos closedpos profile>`` - define turnout/point servo (pwm) on specified vpin

reference/software/command-summary-consolidated:``<t id> - deletes a turnout by id``

reference/software/command-summary-consolidated:``<d servo vpin value [profile]>`` - set servo position to value on pin vpin

reference/software/command-summary-consolidated:``<t id addr subaddr>`` - define a turnout on a dcc accessory decoder with the specified address and subaddress - legacy command |deprecated|

reference/software/command-summary-consolidated:``<t id vpin activepos inactivepos>`` - define a turnout/point servo on specified vpin - legacy command |deprecated|

reference/software/command-summary-consolidated:turntables/traversers (configuring the ex-commandstation)

reference/software/command-summary-consolidated:``<i id dcc home>`` - define a dcc accessory turntable/traverser

reference/software/command-summary-consolidated:``<i id extt vpin home>`` - define an ex-turntable turntable/traverser

reference/software/command-summary-consolidated:``<i id add position value angle>`` - add a position to a turntable/traverser

reference/software/command-summary-consolidated:sensors (configuring the ex-commandstation)

reference/software/command-summary-consolidated:``<s id vpin pullup>`` - create a new sensor id

reference/software/command-summary-consolidated:``<s id>`` - delete defined sensor

reference/software/command-summary-consolidated:``</ latch vpin>`` - lock sensor on, preventing external influence

reference/software/command-summary-consolidated:``</ unlatch vpin>`` - unlock sensor, returning to current external state

reference/software/command-summary-consolidated:outputs (configuring the ex-commandstation)

reference/software/command-summary-consolidated:``<z vpin> or <z -vpin>`` - control an output pin; no setup required

reference/software/command-summary-consolidated:``<z id vpin iflag>`` - creates a new output id, with specified pin and iflag values

reference/software/command-summary-consolidated:``<z id>`` - deletes definition of output id

reference/software/command-summary-consolidated:``<z>`` -lists all defined output pins

reference/software/command-summary-consolidated:``<z id state>`` - sets output id to either inactive or active state

reference/software/command-summary-consolidated:eeprom management (configuring the ex-commandstation)

reference/software/command-summary-consolidated:``<d eeprom>`` - diagnostic dump eeprom contents

reference/software/command-summary-consolidated:``<e>`` - erase all (turnouts, sensors, and outputs) from eeprom

reference/software/command-summary-consolidated:``<e>`` - store definitions to eeprom

reference/software/command-summary-consolidated:diagnostic programming commands (configuring the ex-commandstation)

reference/software/command-summary-consolidated:``<d ack state>`` - enables ack diagnostics

reference/software/command-summary-consolidated:``<d cmd state>`` - enables command parser diagnostics

reference/software/command-summary-consolidated:``<d ethernet state>`` - enables ethernet diagnostics

reference/software/command-summary-consolidated:``<d lcn state>`` - enables lcn interface diagnostics

reference/software/command-summary-consolidated:``<d wifi state>`` - enables wifi diagnostics

reference/software/command-summary-consolidated:``<d wit state>`` - enables withrottle diagnostics

reference/software/command-summary-consolidated:``<d cabs>`` - shows cab numbers and speed in reminder tables

reference/software/command-summary-consolidated:``<d hal show>`` - shows configured servo board and gpio extender board config and used pins

reference/software/command-summary-consolidated:``<d ram>`` - shows remaining ram (free memory)

reference/software/command-summary-consolidated:i/o (hal) diagnostics

reference/software/command-summary-consolidated:``<d anin vpin>`` - read and display pin vpin's analogue value

reference/software/command-summary-consolidated:``<d anout vpin value [param2]>`` - write value to analogue vpin

reference/software/command-summary-consolidated:``<u cmd>`` - is reserved for user commands (through user filter)

reference/software/programming-locos:dcc-ex & jmri decoderpro getting started guide

reference/software/programming-locos:programming cvs with ex-toolbox app

reference/software/programming-locos:programming cvs with engine driver app

reference/software/withrottle-vs-native-commands:withrottle protocol vs dcc-ex native commands

reference/software/withrottle-vs-native-commands:dcc-ex native protocol / commands

reference/software/withrottle-vs-native-commands:which should you use?

reference/tools/diagnostic-d-ack-command:diagnostics ``<d ack>`` command

reference/tools/diagnostic-d-ack-command:making the changes permanent

reference/tools/diagnostic-d-command:diagnostics ``<d>`` command

reference/tools/diagnostic-d-command:the following commands turn on(1) or off(0) various diagnostic traces

reference/tools/diagnostic-d-command:the following commands might help in exceptional circumstances

reference/tools/diagnostic-tools:connect directly to the signal output (enable pin) of the arduino cs

reference/tools/diagnostic-tools:capture the samples in pulseview

reference/tools/diagnostic-tools:using a digital multimeter (dmm)

reference/tools/serial-monitor:what is a serial monitor and why do i need one?

reference/tools/serial-monitor:connect with ex-installer and device monitor

reference/tools/serial-monitor:connect with the arduino ide serial monitor

reference/tools/serial-monitor:download and install the arduino ide

support/ex-cs-troubleshooting:cannot connect to the ex-commandstation over wifi

support/ex-cs-troubleshooting:is it plugged in, is it turned on?

support/ex-cs-troubleshooting:testing the arduino and ex-commandstation code

support/ex-cs-troubleshooting:loco programming issues (-1 or jmri 308 error)

support/ex-cs-troubleshooting__included-diy:cannot drive a locomotive

support/ex-cs-troubleshooting__included-diy:cannot connect to the ex-commandstation over wifi

support/ex-cs-troubleshooting__included-diy:is it plugged in, is it turned on?

support/ex-cs-troubleshooting__included-diy:testing the arduino and ex-commandstation code

support/ex-cs-troubleshooting__included-diy:testing the motor shield

support/ex-cs-troubleshooting__included-diy:testing the dcc signal

support/ex-cs-troubleshooting__included-diy:loco programming issues (-1 or jmri 308 error)

support/ex-cs-troubleshooting__included-esb1:cannot drive a locomotive

support/ex-cs-troubleshooting__included-esb1:cannot connect to the ex-commandstation over wifi

support/ex-cs-troubleshooting__included-esb1:is it plugged in, is it turned on?

support/ex-cs-troubleshooting__included-esb1:testing the arduino and ex-commandstation code

support/ex-cs-troubleshooting__included-esb1:testing the motor shield

support/ex-cs-troubleshooting__included-esb1:testing the dcc signal

support/ex-cs-troubleshooting__included-esb1:loco programming issues (-1 or jmri 308 error)

support/ex-cs-troubleshooting__included-rtr:cannot drive a locomotive

support/ex-cs-troubleshooting__included-rtr:cannot connect to the ex-commandstation over wifi

support/ex-cs-troubleshooting__included-rtr:is it plugged in, is it turned on?

support/ex-cs-troubleshooting__included-rtr:testing the arduino and ex-commandstation code

support/ex-cs-troubleshooting__included-rtr:testing the motor shield

support/ex-cs-troubleshooting__included-rtr:testing the dcc signal

support/ex-cs-troubleshooting__included-rtr:loco programming issues (-1 or jmri 308 error)

support/ex-io-troubleshooting:ex-ioexpander |br| faq and troubleshooting

support/ex-tt-troubleshooting:ex-turntable |br| faq and troubleshooting

support/ex-tt-troubleshooting:turntable judders, stalls, or fails to rotate

support/ex-tt-troubleshooting:track power is cut when locomotive enters turntable bridge track

support/ex-tt-troubleshooting:ex-commandstation compile errors with device driver enabled

support/ex-tt-troubleshooting:ex-turntable showing as offline with <d hal show>

support/index-ex-cs:frequently asked questions and troubleshooting

support/makerfabs-update-at-version-with-mega:makerfabs esp8266 - update at version with an arduino mega

support/makerfabs-update-at-version-with-mega:step 1. get esptool

support/makerfabs-update-at-version-with-mega:step 2. get the 1.7.4 as a whole image

support/makerfabs-update-at-version-with-mega:step 3. prepare the hardware

support/makerfabs-update-at-version-with-mega:step 4. connect your computer

support/makerfabs-update-at-version-with-mega:step 5. flash with esptool

support/makerfabs-update-at-version-with-mega:step 6. check that flash was successful

support/makerfabs-update-at-version-with-mega:step 7. prepare your ex-commandstation

support/wifi-at-version:esp8266 (wifi boards) - at version issues and solutions

support/wifi-at-version:which is correct version of the at firmware

support/wifi-at-version:symptoms of an incorrect firmware version

support/wifi-at-version:checking after you load the ex-commandstation software

support/wifi-at-version:checking the at version using ex-installer

support/wifi-at-version:checking the at version using ex-webthrottle

support/wifi-at-version:checking the at version with the arduino ide

support/wifi-at-version:checking before you load the ex-commandstation software

support/wifi-at-version:checking the at version of a esp-01 or esp-01s

support/wifi-at-version:checking the at version of a esp-01 with a usb serial adapter

support/wifi-at-version:checking the at version of a esp-01 a with a usb to ttl ch340g converter module adapter

support/wifi-at-version:checking the at version of a esp-01 a with a arduino uno

support/wifi-at-version:checking the at version of a makerfabs esp8266 wifi shield

support/wifi-at-version:checking the at version of a duinopeak esp8266 wifi expansion board

support/wifi-at-version:what to do if you have the wrong at firmware version

support/wifi-at-version:correcting a esp-01 with a usb serial adapter

support/wifi-at-version:correcting a esp-01 with a usb to esp-01 adapter board

support/wifi-at-version:correcting the at version on a makerfabs esp8266 wifi shield

support/wifi-at-version:correcting the makerfabs esp8266 wifi shield with a usb to ttl converter module adapter

support/wifi-at-version:correcting the makerfabs esp8266 wifi shield with an arduino mega

support/wifi-at-version:correcting the at version on a duinopeak esp8266 wifi expansion board

support/wifi-at-version:correcting the at version on a mega+wifi

throttles/connect_wifi_throttle_via_usb:connecting wifi throttles via usb

throttles/connect_wifi_throttle_via_usb:troubleshooting (windows socat)

throttles/driveaway:sample wifi throttle app "discovered servers"

throttles/driveaway:new ex-commandstation 4.0 exrail "roster" feature

throttles/hardware/engine-driver-physical-knobs:adding a physical dial/knob to engine driver

throttles/hardware/ex-t3-wifi:ex-t3-wifi (t3 = tactile touch throttle)

throttles/hardware/lodi-con-wifi-throttle:lodi-con wifi throttle

throttles/hardware/uwt50:tcs uwt-50 & uwt-100 wifi throttles (physical)

throttles/native-protocol-library:dcc-ex native command protocol library - dccexprotocol

throttles/protocols:withrottle server, web server, dcc-ex native protocol explained

throttles/software/android-apps-on-windows:android apps on windows & macos

throttles/software/engine-driver:standard features (all withrottle servers)

throttles/software/engine-driver:ex-commandstation specific or advantageous features

throttles/software/engine-driver:ex-commandstation specific features - when using the dcc-ex native protocol

throttles/software/engine-driver:recording a log file in enginedriver

throttles/software/engine-driver-native-protocol:engine driver - features when using the native protocol

throttles/software/engine-driver-native-protocol:specific features - when using the dcc-ex native protocol

throttles/software/engine-driver-native-protocol:how to enable the |dcc-ex native protocol|

throttles/software/engine-driver-native-protocol:using the dcc-ex native features

throttles/software/engine-driver-native-protocol:read and write dcc addresses on the programming track

throttles/software/engine-driver-native-protocol:read and write cvs of decoders on the programming track

throttles/software/engine-driver-native-protocol:write cvs of decoders on the main track

throttles/software/engine-driver-native-protocol:issue native commands to the |ex-cs|

throttles/software/jmri:ex-commandstation & jmri decoderpro programming station

throttles/tech-reference:technical reference for throttle developers

throttles/tech-reference:dcc-ex native command library - dccexprotocol

trackmanager/index:changing a motor driver output to a different dcc mode

trackmanager/index:if you used engine driver, ex-toolbox or a command (dc)

trackmanager/index:replacing or integrating into your current layout

trackmanager/index:trackmanager technical details and detailed instructions

trackmanager/index:how do you run a ex-commandstation in dc (pwm) mode?

trackmanager/index:controlling & managing dcc-ex trackmanager modes

trackmanager/index:exrail list of track manager functions for engine driver automatic assign [handoff] buttons

trackmanager/index:exrail track manager functions for engine driver 'automation' [handoff] buttons

trackmanager/index:exrail track manager functions for engine driver 'route' [set] buttons

trackmanager/index:example - exrail scripts running on engine driver app (android)

trackmanager/index:exrail functions on smartphone apps & universal wifi throttles

trackmanager/technical-details:trackmanager dcc(pwm) vs. dc(pwm) wave forms

under-development/index:looking for some help with ex-commandstation?

`LOW - Stage 1 <https://github.com/DCC-EX/dcc-ex.github.io/issues/415>`_ |EXTERNAL-LINK| - WiThrottle - Multiple Trains

These "big picture" pages provide a view of how to put all the DCC-EX capabilities to use. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

"Big Picture" Big Picture Examples EX-CommandStation EX-CS Command Station EX-TurnTable EXRAIL Automation routes

.. |force-break| raw:: html

  <div style="display:block; box-sizing: border-box; clear: both;"> </div>

<div style="display:block; box-sizing: border-box; clear: both;"> </div>

.. |image-note| raw:: html

  <span style="font-weight: bold; font-style: italic; color: #767676;" >Note that you can click on any of the images to make them larger.</span>

<span style="font-weight: bold; font-style: italic; color: #767676;" >Note that you can click on any of the images to make them larger.</span>

.. |NOT-IN-PROD-VERSION| raw:: html

  <span style="color:red">This feature is not available in the current 'Production' version</span> <br /> It is available in the 'development' (DEVEL) releases.

<span style="color:red">This feature is not available in the current 'Production' version</span> <br /> It is available in the 'development' (DEVEL) releases.

.. |NEW-IN-V5| raw:: html

  <span class="new-in-v5">New in version 5 </span>

.. |NEW-IN-V5-4| raw:: html

  <span class="new-in-v5-4">New in version 5.4 </span>

.. |DEPRECATED| raw:: html

  <span style="font-weight: bold; font-style: italic; color:red">Deprecated</span>

.. |EX-PLACEHOLDER| image:: /_static/images/logos/placeholder.png
      :alt: Dummy Placeholder
      :scale: 40%
      :class: image-product-logo-float-right

image:: /_static/images/logos/placeholder.png

.. |EX-CS-LOGO| image:: /_static/images/logos/product-logo-ex-commandstation.png
      :alt: EX-CommandStation

image:: /_static/images/logos/product-logo-ex-commandstation.png

.. |EX-I-LOGO| image:: /_static/images/logos/product-logo-ex-installer.png
      :alt: EX-Installer

image:: /_static/images/logos/product-logo-ex-installer.png

.. |EX-WT-LOGO| image:: /_static/images/logos/product-logo-ex-webthrottle.png
      :alt: EX-WebThrottle

image:: /_static/images/logos/product-logo-ex-webthrottle.png

.. |EX-R-LOGO| image:: /_static/images/logos/product-logo-exrail.png
      :alt: EXRAIL

image:: /_static/images/logos/product-logo-exrail.png

.. |EX-TT-LOGO| image:: /_static/images/logos/product-logo-ex-turntable.png
      :alt: EX-Turntable

image:: /_static/images/logos/product-logo-ex-turntable.png

.. |EX-FC-LOGO| image:: /_static/images/logos/product-logo-ex-fastclock.png
      :alt: EX-FastClock

image:: /_static/images/logos/product-logo-ex-fastclock.png

.. |EX-DCCI-LOGO| image:: /_static/images/logos/product-logo-ex-dccinspector.png
      :alt: EX-DCCInspector

image:: /_static/images/logos/product-logo-ex-dccinspector.png

.. |EX-BSC-LOGO| image:: /_static/images/logos/product-logo-basestationclassic.png
      :alt: BaseStationClassic

image:: /_static/images/logos/product-logo-basestationclassic.png

.. |EX-TB-LOGO| image:: /_static/images/logos/product-logo-ex-toolbox.png
      :alt: EX-Toolbox

image:: /_static/images/logos/product-logo-ex-toolbox.png

.. |EX-MS-LOGO| image:: /_static/images/logos/product-logo-ex-motorshield8874.png
      :alt: EX-MotorShield8874

image:: /_static/images/logos/product-logo-ex-motorshield8874.png

.. |EX-BP-LOGO| image:: /_static/images/logos/product-logo-bigpicture.png
      :alt: The Big Picture

image:: /_static/images/logos/product-logo-bigpicture.png

.. |EX-AN-LOGO| image:: /_static/images/logos/product-logo-announcements.png
      :alt: Announcements

image:: /_static/images/logos/product-logo-announcements.png

.. |EX-DL-LOGO| image:: /_static/images/logos/product-logo-download.png
      :alt: Downloads

image:: /_static/images/logos/product-logo-download.png

.. |EX-REF-LOGO| image:: /_static/images/logos/product-logo-reference.png
      :alt: Reference

image:: /_static/images/logos/product-logo-reference.png

.. |EX-THROTTLES-LOGO| image:: /_static/images/logos/product-logo-throttles.png
      :alt: Throttles

image:: /_static/images/logos/product-logo-throttles.png

.. |EX-CONTRIBUTING-LOGO| image:: /_static/images/logos/product-logo-contributing.png
      :alt: Contributing

image:: /_static/images/logos/product-logo-contributing.png

.. |EX-SUPPORT-LOGO| image:: /_static/images/logos/product-logo-ex-support.png
      :alt: EX-Support

image:: /_static/images/logos/product-logo-ex-support.png

.. |EX-IO-LOGO| image:: /_static/images/logos/product-logo-ex-ioexpander.png

image:: /_static/images/logos/product-logo-ex-ioexpander.png

.. |EX-NEWS-LOGO| image:: /_static/images/logos/product-logo-news.png
      :alt: DCC-EX News

image:: /_static/images/logos/product-logo-news.png

.. |EX-SUPPLIERS-LOGO| image:: /_static/images/logos/product-logo-suppliers.png
      :alt: DCC-EX Suppliers

image:: /_static/images/logos/product-logo-suppliers.png

.. |TRACKMANAGER-LOGO| image:: /_static/images/logos/product-logo-trackmanager.png
      :alt: DCC-EX Track Manager

image:: /_static/images/logos/product-logo-trackmanager.png

.. |NATIVE-PROTOCOL_LIBRARY-LOGO| image:: /_static/images/logos/product-logo-native-protocol-library.png
      :alt: DCC-EX Native Protocol Library

image:: /_static/images/logos/product-logo-native-protocol-library.png

.. |EX-BP-LOGO-SMALL| image:: /_static/images/logos/product-logo-bigpicture.png
      :scale: 30%
      :class: image-float-right

.. |EX-R-FULL| raw:: html

  <span class="ex-prefix">EX</span><span class="ex-suffix">tended </span>
  <span class="ex-prefix">R</span><span class="ex-suffix">ailroad</span>
  <span class="ex-prefix">A</span><span class="ex-suffix">utomation</span>
  <span class="ex-prefix">I</span><span class="ex-suffix">nstruction</span>
  <span class="ex-prefix">L</span><span class="ex-suffix">anguage</span>

<span class="ex-prefix">EX</span><span class="ex-suffix">tended </span>
<span class="ex-prefix">R</span><span class="ex-suffix">ailroad</span>
<span class="ex-prefix">A</span><span class="ex-suffix">utomation</span>
<span class="ex-prefix">I</span><span class="ex-suffix">nstruction</span>
<span class="ex-prefix">L</span><span class="ex-suffix">anguage</span>

.. |Motor Driver| replace::

    :doc:`Motor Driver </reference/hardware/motor-boards>`

.. |Engine Driver| replace::

    :doc:`Engine Driver </throttles/software/engine-driver>`

.. |ED| replace::

.. |wiThrottle| replace::

    :doc:`wiThrottle </throttles/software/withrottle>`

.. |wiThrottle Lite| replace::

    :doc:`wiThrottle Lite </throttles/software/withrottle>`

.. |ThrottleCard| replace::

    :doc:`ThrottleCard </throttles/software/throttlecard>`

.. |wiThrottle Protocol| replace::

    :doc:`wiThrottle Protocol </reference/software/withrottle-vs-native-commands>`

:doc:`wiThrottle Protocol </reference/software/withrottle-vs-native-commands>`

.. |wiThrottle Server| replace::

    :doc:`wiThrottle Server </reference/software/withrottle-vs-native-commands>`

:doc:`wiThrottle Server </reference/software/withrottle-vs-native-commands>`

.. |Access Point| replace::

    :doc:`Access Point (AP) </ex-commandstation/advanced-setup/supported-wifi/wifi-config>`

:doc:`Access Point (AP) </ex-commandstation/advanced-setup/supported-wifi/wifi-config>`

.. |Access Point Mode| replace::

    :doc:`Access Point (AP) Mode </ex-commandstation/advanced-setup/supported-wifi/wifi-config>`

:doc:`Access Point (AP) Mode </ex-commandstation/advanced-setup/supported-wifi/wifi-config>`

.. |Station Mode| replace::

    :doc:`Station (STA) Mode  </ex-commandstation/advanced-setup/supported-wifi/wifi-config>`

:doc:`Station (STA) Mode  </ex-commandstation/advanced-setup/supported-wifi/wifi-config>`

.. |Arduino IDE| replace::

    :doc:`Arduino IDE </ex-commandstation/advanced-setup/installation-options/arduino-ide>`

.. |VSC| replace::

    :doc:`Visual Studio Code (VSC) </reference/glossary>`

.. |DCC-EX Native Commands| replace::

    :doc:`DCC-EX Native Commands </reference/software/withrottle-vs-native-commands>`

:doc:`DCC-EX Native Commands </reference/software/withrottle-vs-native-commands>`

.. |DCC-EX Native Protocol| replace::

    :doc:`DCC-EX Native Protocol </reference/software/withrottle-vs-native-commands>`

.. |DC PWM| replace::

    :doc:`DC PWM </reference/hardware/dcc-vs-dc>`

.. |DC| replace::

    :doc:`DC </reference/hardware/dcc-vs-dc>`

.. |DCC| replace::

    :doc:`DCC </reference/hardware/dcc-vs-dc>`

.. |Serial Monitor| replace::

    :doc:`Serial Monitor </reference/tools/serial-monitor>`

.. |IDE Serial Monitor| replace::

    :ref:`Arduino IDE Serial Monitor <reference/tools/serial-monitor:connect with the arduino ide serial monitor>`

:ref:`Arduino IDE Serial Monitor <reference/tools/serial-monitor:connect with the arduino ide serial monitor>`

.. |Device Monitor| replace::

    :ref:`EX-Installer Device Monitor <ex-installer/testing:using the ex-installer device monitor>`

:ref:`EX-Installer Device Monitor <ex-installer/testing:using the ex-installer device monitor>`

.. |STANDARD MOTOR DRIVER| replace::

    :abbr:`Standard Motor Driver (Either the 'Arduino Motor Shield R38' or 'Deek-Robot Motor Shield'.)`

:abbr:`Standard Motor Driver (Either the 'Arduino Motor Shield R38' or 'Deek-Robot Motor Shield'.)`

Either the 'Arduino Motor Shield R38' or 'Deek-Robot Motor Shield'.

.. |MOTOR DRIVER| replace::

    :abbr:`Motor Driver (also referred to as a 'Motor Controller', 'Motor Shield' or 'Motor Board')`

:abbr:`Motor Driver (also referred to as a 'Motor Controller', 'Motor Shield' or 'Motor Board')`

also referred to as a 'Motor Controller', 'Motor Shield' or 'Motor Board'

.. |MOTOR SHIELD| replace::

    :abbr:`Motor Shield (also referred to as a 'Motor Controller', 'Motor Driver' or Motor Board')`

:abbr:`Motor Shield (also referred to as a 'Motor Controller', 'Motor Driver' or Motor Board')`

also referred to as a 'Motor Controller', 'Motor Driver' or Motor Board'

.. |RTR| replace::

    :abbr:`RTR (Ready-to-run / plug-and-play)`

.. |Booster Mode| replace::

    :doc:`Booster Mode </ex-commandstation/rtr-booster>`

.. |DCC-EX| raw:: html

  <a href="../index.html"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a>

<a href="../index.html"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a>

.. |EX-CS| raw:: html

  <a href="../ex-commandstation/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>

.. |EX-WS| raw:: html

  <a href="../reference/hardware/motorboards/ex-motor-shield-8874.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;WiFiShield 8874</span></a>

<a href="../reference/hardware/motorboards/ex-motor-shield-8874.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;WiFiShield 8874</span></a>

.. |EX-WT| raw:: html

  <a href="../ex-webthrottle/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;WebThrottle</span></a>

.. |EX-R| raw:: html

  <a href="../exrail/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">RAIL</span></a>

.. |EX-I| raw:: html

  <a href="../ex-installer/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Installer</span></a>

.. |EX-TT| raw:: html

  <a href="../ex-turntable/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Turntable</span></a>

.. |EX-FC| raw:: html

  <a href="../ex-fastclock/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;FastClock</span></a>

.. |EX-DCCI| raw:: html

  <a href="../ex-dccinspector/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;DCCInspector</span></a>

.. |EX-IO| raw:: html

  <a href="../ex-ioexpander/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;IOExpander</span></a>

.. |EX-TB| raw:: html

  <a href="../ex-toolbox/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Toolbox</span></a>

<a href="../ex-toolbox/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Toolbox</span></a>

.. |EX-MS| raw:: html

  <a href="../reference/hardware/motorboards/ex-motor-shield-8874.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;MotorShield8874</span></a>

.. |EX-CSB1| raw:: html

  <a href="../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation&thinsp;/&thinsp;Booster One Express</span></a>

.. |EX-CSB1-SHORT| raw:: html

  <a href="../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CSB1</span></a>

.. |BSC| raw:: html

  <span class="ex-suffix">BaseStationClassic (DCC++)</span>

.. |TM| raw:: html

  <span class="ex-suffix">TrackManager</span>

.. |DCC-EXP| raw:: html

  <a href="../throttles/native-protocol-library.html"><span class="dccex-suffix">DCCEX</span><span class="dccex-prefix">Protocol</span></a>

.. |EX-CSB1-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-csb1.png
      :alt: EX-CSB1 Logo
      :class: image-min-width-144
      :target: ../ex-commandstation/rtr-index.html

image:: /_static/images/logos/product-logo-ex-csb1.png

.. |EX-CS-DIY-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-cs-diy.png
      :alt: EX-CS-DIY Logo
      :target: ../ex-commandstation/diy/index.html

image:: /_static/images/logos/product-logo-ex-cs-diy.png

.. |EX-CS-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-commandstation.png
      :target: ../ex-commandstation/index.html

.. |EX-I-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-installer.png
      :target: ../ex-installer/index.html

.. |EX-WT-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-webthrottle.png
      :target: ../ex-webthrottle/index.html

.. |EX-R-LOGO-SMALL| image:: /_static/images/logos/product-logo-exrail.png
      :target: ../exrail/index.html

.. |EX-TT-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-turntable.png
      :target: ../ex-turntable/index.html

.. |EX-FC-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-fastclock.png
      :target: ../ex-fastclock/index.html

.. |EX-DCCI-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-dccinspector.png
      :target: ../ex-dccinspector/index.html

.. |EX-IO-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-ioexpander.png
      :alt: EX-IOExpander
      :target: ../ex-ioexpander/index.html

.. |EX-BSC-LOGO-SMALL| image:: /_static/images/logos/product-logo-basestationclassic.png
      :alt: baseStationClassic
      :target: ../download/ex-commandstation.html#getting-basestation-classic

.. |EX-TB-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-toolbox.png
      :target: ../ex-toolbox/index.html

.. |EX-MS-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-motorshield8874.png
      :alt: EX-MotorShield 8874
      :target: ../reference/hardware/motorboards/ex-motor-shield-8874.html

.. |EX-WS-LOGO-SMALL| image:: /_static/images/logos/product-logo-ex-wifishield8266.png
      :alt: EX-WiFiShield 8266
      :target: ../reference/hardware/wifi-boards/makerfabs-esp8266.html

image:: /_static/images/logos/product-logo-ex-wifishield8266.png

.. |TRACKMANAGER-LOGO-SMALL| image:: /_static/images/logos/product-logo-trackmanager.png
      :alt: DCC-EX TrackManager
      :target: ../trackmanager/index.html

.. |NEW-IN-V5-LOGO-SMALL| image:: /_static/images/logos/new_in_version_5.png
      :alt: New In Version 5
      :target: ../news/posts/20230807.html

image:: /_static/images/logos/new_in_version_5.png

.. |NEW-IN-V5-4-LOGO-SMALL| image:: /_static/images/logos/new_in_version_5_4.png
      :alt: New In Version 5.4
      :class: image-min-width-144 show_light

image:: /_static/images/logos/new_in_version_5_4.png

.. |NEW-IN-V5-4-LOGO-SMALL-DARK| image:: /_static/images/logos/new_in_version_5_4_dark.png
      :class: image-min-width-144 show_dark

image:: /_static/images/logos/new_in_version_5_4_dark.png

.. |donate-button| image:: /_static/images/icons/donate_button_blue.png
   :alt: Donate Button
   :class: float-right
   :scale: 25%
   :target: ../about/contributing/donate.html

image:: /_static/images/icons/donate_button_blue.png

.. |conductor| image:: /_static/images/level_icons/conductor-level.png
   :alt: Conductor Hat
   :scale: 40%
   :target: ../begin/levels.html#conductor

image:: /_static/images/level_icons/conductor-level.png

.. |tinkerer| image:: /_static/images/level_icons/tinkerer-level.png
   :alt: Propeller Beanie
   :target: ../begin/levels.html#tinkerer

image:: /_static/images/level_icons/tinkerer-level.png

.. |engineer| image:: /_static/images/level_icons/engineer-level.png
   :alt: Engineer Hat
   :target: ../begin/levels.html#engineer

image:: /_static/images/level_icons/engineer-level.png

.. |conductor-no-text| image:: /_static/images/level_icons/conductor.png

image:: /_static/images/level_icons/conductor.png

.. |tinkerer-no-text| image:: /_static/images/level_icons/tinkerer.png

image:: /_static/images/level_icons/tinkerer.png

.. |engineer-no-text| image:: /_static/images/level_icons/engineer.png
  :alt: Engineer Hat
  :scale: 40%
  :target: ../begin/levels.html#engineer

image:: /_static/images/level_icons/engineer.png

.. |conductor-text| raw:: html

  <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../begin/levels.html#conductor">Conductor</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../begin/levels.html#conductor">Conductor</a>

.. |tinkerer-text| raw:: html

  <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../begin/levels.html#tinkerer">Tinkerer</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../begin/levels.html#tinkerer">Tinkerer</a>

.. |engineer-text| raw:: html

  <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../begin/levels.html#engineer">Engineer</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../begin/levels.html#engineer">Engineer</a>

.. |suitable| image:: /_static/images/level_icons/level-suitable-for.png
   :alt: Suitable For Level:
   :target: ../begin/levels.html#levels-of-difficulty-or-technical-complexity

image:: /_static/images/level_icons/level-suitable-for.png

.. |support-button| raw:: html

   <a href="../support/index.html#contact-support-options" title="Request help or support"><img src="../_static/images/buttons/support.png" style="height: 33px;" /></a>

<a href="../support/index.html#contact-support-options" title="Request help or support"><img src="../_static/images/buttons/support.png" style="height: 33px;" /></a>

.. |support-button-large| raw:: html

   <a href="../support/index.html#contact-support-options" title="Request help or support"><img src="../_static/images/buttons/support.png" style="width: 10%; height: 10%;" /></a>

<a href="../support/index.html#contact-support-options" title="Request help or support"><img src="../_static/images/buttons/support.png" style="width: 10%; height: 10%;" /></a>

.. |EXTERNAL-LINK| raw:: html

  <img src="../_static/images/external-link.svg" style="width: 16px; height: 16px; margin-top: -3px;">

<img src="../_static/images/external-link.svg" style="width: 16px; height: 16px; margin-top: -3px;">

.. |githublink-ex-turntable-button-small| raw:: html

  <a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

.. |githublink-ex-dccinspector-button-small| raw:: html

  <a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

.. |githublink-ex-webthrottle-button-small| raw:: html

  <a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

.. |githublink-ex-installer-button-small| raw:: html

  <a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

.. |githublink-ex-commandstation-button-small| raw:: html

  <a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

.. |githublink-ex-csb1-button-small| raw:: html

.. |githublink-ex-ioexpander-button-small| raw:: html

  <a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

.. |githublink-ex-fastclock-button-small| raw:: html

  <a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

.. |githublink-ex-turntable| raw:: html

   <a class="githublink" href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

<a class="githublink" href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

.. |githublink-ex-turntable-button| raw:: html

   <a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

<a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

.. |githublink-ex-dccinspector-button| raw:: html

   <a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

.. |githublink-ex-webthrottle-button| raw:: html

   <a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

.. |githublink-ex-installer-button| raw:: html

  <a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

.. |githublink-ex-commandstation-button| raw:: html

  <a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

.. |githublink-ex-csb1-button| raw:: html

.. |githublink-ex-ioexpander-button| raw:: html

  <a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

.. |githublink-ex-fastclock-button| raw:: html

  <a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

[comment] this adds a specific HTML meta *description* to the page.  You can alternately use the generic description (include-description.rst) for the page.  DO NOT use both this and generic description on the same page.

There are a lot of different throttle options available to control your trains and layout, including software applications available for your smart phone or computer and physical hardware options, both wired and wireless.

Going in to any detail on the myriad of options available is well outside the scope of this exercise, so on this page we will be focusing on the four options most commonly used with |EX-CS|: |EX-WT|, |Engine Driver|, |WiThrottle|, and |JMRi|.

Going in to any detail on the myriad of options available is well outside the scope of this exercise, so on this page we will be focusing on the four options most commonly used with 

For other throttle options, refer to the :doc:`/ex-commandstation/advanced-setup/controllers` page for further information on choosing a throttle, and you can also refer to the  :doc:`/throttles/index` section for more information on the various throttle options available.

 page for further information on choosing a throttle, and you can also refer to the  

 section for more information on the various throttle options available.

At the end of this stage, we expect you will have learnt the following:

How to run a train on your direct connected |EX-CS| with |EX-WT|

How to run more than one train (Individual or Consist/Multiple Units)

If you're just starting out with |EX-CS|, or have a minimal system with no WiFi or Ethernet connection options, then a great way to start simply is by using |EX-WT| via your direct USB connection.

, or have a minimal system with no WiFi or Ethernet connection options, then a great way to start simply is by using 

This is by far the simplest option to verify your |EX-CS| is set up and working correctly, as you don't need to install any software or worry about any network connections to get your first train running on your layout.

 is set up and working correctly, as you don’t need to install any software or worry about any network connections to get your first train running on your layout.

While there is a lot more detail on the :doc:`/ex-webthrottle/index` page, we will give you a very quick start guide here to get a single train running with your |EX-CS|.

 page, we will give you a very quick start guide here to get a single train running with your 

Firstly, launch :guilabel:`EX-WebThrottle` in your Chromium based web browser (Google Chrome, Microsoft Edge, or Opera).

 in your Chromium based web browser (Google Chrome, Microsoft Edge, or Opera).

`Try It Now <https://DCC-EX.github.io/WebThrottle-EX>`_ |EXTERNAL-LINK|

Once you have |EX-WT| opened in your browser, follow these steps to get your train running:

 opened in your browser, follow these steps to get your train running:

Ensure your |EX-CS| is connected to your computer via the USB cable

In the top right corner, ensure "Serial" is selected from the pull down menu, then click the :guilabel:`Connect DCC++ EX` button

In the top right corner, ensure “Serial” is selected from the pull down menu, then click the 

A pop up window should appear, prompting you to choose your COM port

Select the COM port then click the :guilabel:`Connect` button, and the button in the top right corner should change to :guilabel:`Disconnect DCC++ EX` with a green circle to the left

 button, and the button in the top right corner should change to 

Type the DCC address of your loco into the "Locomotive ID" text box, then click the :guilabel:`>` button to set it

Type the DCC address of your loco into the “Locomotive ID” text box, then click the 

You can now use the throttle slider or :guilabel:`+` and :guilabel:`-` buttons to set the speed, and the slider in the centre of the screen to set forward, reverse, stop, or EStop

 buttons to set the speed, and the slider in the centre of the screen to set forward, reverse, stop, or EStop

The function buttons to the right can also be used to set the various functions supported by your decoder

If when you assembled your |EX-CS| with one of the common configuration options, then you will have a WiFi enabled Command Station, which will allow to run your trains with a smart phone. We are only going to cover two common options here:

 with one of the common configuration options, then you will have a WiFi enabled Command Station, which will allow to run your trains with a smart phone. We are only going to cover two common options here:

If you have set up your |EX-CS| in |Access Point Mode| (The Recommended approach)

* Open the network settings on you phone
* Change to the network of the |EX-CS|

  * SSID (Network name) : 'DCCEX_xxxxxx' |BR| where the x's are the last 6 digits of your device' MAC address (unique to each device)
  * Password: 'PASS_xxxxxx' |BR| where the x's are the last 6 digits of your device' MAC address (same as above)

Change to the network of the |EX-CS|

* SSID (Network name) : 'DCCEX_xxxxxx' |BR| where the x's are the last 6 digits of your device' MAC address (unique to each device)
* Password: 'PASS_xxxxxx' |BR| where the x's are the last 6 digits of your device' MAC address (same as above)

SSID (Network name) : 'DCCEX_xxxxxx' |BR| where the x's are the last 6 digits of your device' MAC address (unique to each device)

 where the x’s are the last 6 digits of your device’ MAC address (unique to each device)

Password: 'PASS_xxxxxx' |BR| where the x's are the last 6 digits of your device' MAC address (same as above)

 where the x’s are the last 6 digits of your device’ MAC address (same as above)

If you have set up your |EX-CS| in |Station Mode| (The alternate approach)

* open the network settings on you phone
* change to your home network

  * use your normal home id and password

change to your home network

* use your normal home id and password

Go through the initial startup pages to set some basic configuration items

On the 'Connection screen'

* You should see 'DCCEX_xxxxxx' (as above) in the discovered servers list
* Click on this. |BR| (As long as you did not change the IP address of the |EX-CS| when you ran |EX-I| then this should connect

You should see 'DCCEX_xxxxxx' (as above) in the discovered servers list

You should see ‘DCCEX_xxxxxx’ (as above) in the discovered servers list

Click on this. |BR| (As long as you did not change the IP address of the |EX-CS| when you ran |EX-I| then this should connect

Turn on the power to the track via the menu

 * (The three dots or bars) then 'Power'.  Then click the :guilabel:`power` button till it goes green. (May require more than one click)
 * The two red LEDs, for the main track, on the Motor board will turn on
 * Click :guilabel:`Back`

* (The three dots or bars) then 'Power'.  Then click the :guilabel:`power` button till it goes green. (May require more than one click)
* The two red LEDs, for the main track, on the Motor board will turn on
* Click :guilabel:`Back`

(The three dots or bars) then 'Power'.  Then click the :guilabel:`power` button till it goes green. (May require more than one click)

The two red LEDs, for the main track, on the Motor board will turn on

back on the 'Throttle screen'

* Click one of the :guilabel:`Select` buttons

This will have taken you to the 'Select Loco screen'

* Enter the DCC Address of the loco you put on the track
* Select ``Short`` or ``Long`` (normally if the address is less than 127, it will automatically assume it is short)
* Click :guilabel:`Aquire`

Select ``Short`` or ``Long`` (normally if the address is less than 127, it will automatically assume it is short)

 (normally if the address is less than 127, it will automatically assume it is short)

Back on the 'Throttle screen' you can now use the sliders to move your train.

Back on the ‘Throttle screen’ you can now use the sliders to move your train.

See :doc:`Engine Driver Page </throttles/software/engine-driver>` for details on how to install and run |Engine Driver|.

The free version of |WiThrottle| ('|WiThrottle Lite|') only controls one loco at a time and *does not* offer turnout control or DCC track power control. (Note: EX-CommandStation can be configured to automatically turn the track power on. See the :ref:`EXRAIL examples <exrail/examples:Turn Track Power On at Startup>`.)

The paid version WiThrottle can control multiple locos, can create and control consists, can control turnouts and routes, and can control DCC track power.

 offer turnout control or DCC track power control. (Note: EX-CommandStation can be configured to automatically turn the track power on. See the 

:ref:`EXRAIL examples <exrail/examples:Turn Track Power On at Startup>`

* Change to your home network

  * Use your normal home id and password

Change to your home network

* Use your normal home id and password

|WiThrottle| will try to find the |WiThrottle Server| on the |EX-CS|

If you are using |Access Point Mode|

* It will not find the |WiThrottle Server| automatically
* Enter:

  * The IP Address: ``192.168.4.1``
  * The Port: ``2560``

* |WiThrottle| should then connect

If you are using |Station Mode|

* It should find the |WiThrottle Server| and automatically connect to it

It should find the |WiThrottle Server| and automatically connect to it

Turn the track power on by selecting the 'settings' tab and clicking on the ``Track Power``

Turn the track power on by selecting the ‘settings’ tab and clicking on the 

Enter the DCC Address of the loco you put on the track in the ``Keypad`` field

Select ``Long`` or ``Short`` (normally if the address is less than 127, it should be a 'Short' address.)

 (normally if the address is less than 127, it should be a ‘Short’ address.)

See :doc:`WiThrottle Page </throttles/software/withrottle>` for details on how to install and run |WiThrottle|.

If when you assembled your |EX-CS| configurated to Connect to |JMRI|, then you will have the ability to connect to your Command Station directly (using |JMRI|) to run your trains, or you can use smart phone. We are only going to cover three common options here:

, then you will have the ability to connect to your Command Station directly (using 

) to run your trains, or you can use smart phone. We are only going to cover three common options here:

Turn on the power to the track via the button on the toolbar

* Click the :guilabel:`Power` button till it turns green

Enter the DCC Address of the loco you put on the track in the field in the Address Panel

Before |Engine Driver| or |WiThrottle| can be run via |JMRI|, the |JMRI| WiThrottle Server must be started.  It can be started manually by :menuselection:`menu --> actions --> start withrottle server` or be configured to start automatically whenever JMRI is started
:menuselection:`menu --> edit --> preferences --> start up --> add --> perform action --> start withrottle server`` then save, exit, restart JMRI. A WiThrottle server window should open showing WiThrottle server is running.

 WiThrottle Server must be started.  It can be started manually by 

 or be configured to start automatically whenever JMRI is started

menu ‣ edit ‣ preferences ‣ start up ‣ add ‣ perform action ‣ start withrottle server`

:menuselection:`menu --> edit --> preferences --> start up --> add --> perform action --> start withrottle server``

 then save, exit, restart JMRI. A WiThrottle server window should open showing WiThrottle server is running.

If needed, Go through the initial startup pages to set some basic configuration items

You should see 'My JMRI Railroad' (as above) in the discovered servers list. (Unless you have changed the name when you setup JMRI)

You should see ‘My JMRI Railroad’ (as above) in the discovered servers list. (Unless you have changed the name when you setup JMRI)

Turn on the power to the track via the Menu

 * (The three dots or bars) then 'Power'.  Then click the :guilabel:`Power` button till it goes green. (may require more than one click.)
 * The four red LEDs on the Motor board will turn on

* (The three dots or bars) then 'Power'.  Then click the :guilabel:`Power` button till it goes green. (may require more than one click.)
* The four red LEDs on the Motor board will turn on

(The three dots or bars) then 'Power'.  Then click the :guilabel:`Power` button till it goes green. (may require more than one click.)

Back on the 'Throttle screen'

The free version of |WiThrottle| ('|WiThrottle Lite|') only controls one loco at a time and does not offer turnout control or DCC track power control. (Note: |JMRI| can be configured to automatically turn the track power on.)

The paid version |WiThrottle| can control multiple locos, can create and control consists, can control turnouts and routes, and can control DCC track power.

’) only controls one loco at a time and does not offer turnout control or DCC track power control. (Note: 

 can control multiple locos, can create and control consists, can control turnouts and routes, and can control DCC track power.

Before |Engine Driver| or |WiThrottle| can be run via |JMRI|, the JMRI WiThrottle server must be started.  It can be started manually by :menuselection:`menu --> actions --> start withrottle server` or be configured to start automatically whenever |JMRI| is started
:menuselection:`menu --> edit --> preferences --> start up --> add --> perform action --> start withrottle server`` then save, exit, restart |JMRI|. A WiThrottle server window should open showing WiThrottle server is running.

, the JMRI WiThrottle server must be started.  It can be started manually by 

. A WiThrottle server window should open showing WiThrottle server is running.

* It should find the |WiThrottle Server| in |JMRI| and automatically connect to it

It should find the |WiThrottle Server| in |JMRI| and automatically connect to it

|Engine Driver| can optionally show throttle screen layouts that can provide for between 1 and 6 separate throttles. Each throttle can control and unlimited number of loco as a Consist / Multiple Unit train.

 can optionally show throttle screen layouts that can provide for between 1 and 6 separate throttles. Each throttle can control and unlimited number of loco as a Consist / Multiple Unit train.

To have more than one throttle you need to select a Throttle Screen Layout that has more than one throttle on it.

Use the ``Throttle Screen Layout`` preference to select a layout that supports more than one throttle (:menuselection:`menu --> Preferences --> Throttle Screen Appearance Preferences --> Throttle Screen Layout`).  The numbers in brackets after the Layout name are the number of throttles that the layout supports.

 preference to select a layout that supports more than one throttle (

menu ‣ Preferences ‣ Throttle Screen Appearance Preferences ‣ Throttle Screen Layout

:menuselection:`menu --> Preferences --> Throttle Screen Appearance Preferences --> Throttle Screen Layout`

).  The numbers in brackets after the Layout name are the number of throttles that the layout supports.

Where a layout supports a range of throttles, select the number that you want to show with the ``Number of Throttles`` preference (:menuselection:`menu --> Preferences --> Throttle Screen Appearance Preferences --> Number of Throttles`).

Where a layout supports a range of throttles, select the number that you want to show with the 

menu ‣ Preferences ‣ Throttle Screen Appearance Preferences ‣ Number of Throttles

:menuselection:`menu --> Preferences --> Throttle Screen Appearance Preferences --> Number of Throttles`

See the `Throttle Screen Appearance Preferences <https://flash62au.github.io/EngineDriver_Home/configuration/preferences.html#throttle-screen-appearance-preferences>`_ |EXTERNAL-LINK| page on the main |Engine Driver| help sites for detailed information on the options that each Throttle Screen Layout offers.

`Throttle Screen Appearance Preferences <https://flash62au.github.io/EngineDriver_Home/configuration/preferences.html#throttle-screen-appearance-preferences>`_

 help sites for detailed information on the options that each Throttle Screen Layout offers.

Adding additional locos to the Consist / Multiple Unit train is identical to the process of selecting a single loco.  Simply click on the :guilabel:`Select` button, which will be showing the name or address of any locos already selected.

Adding additional locos to the Consist / Multiple Unit train is identical to the process of selecting a single loco.  Simply click on the 

 button, which will be showing the name or address of any locos already selected.

After selecting each additional loco, the Consist Edit screen will be shown. This allows you to:

The free version of |WiThrottle| ('|WiThrottle Lite|') does not provide any options for running multiple trains or Consisted / Multiple Unit trains.  You need to purchase the paid/full version.

’) does not provide any options for running multiple trains or Consisted / Multiple Unit trains.  You need to purchase the paid/full version.

|DCC-EX| provides an Android app |EX-TB| with a basic interface for programming DCC decoders, but it requires that you connect to the |EX-CS| over WiFi or Ethernet. (USB is not supported.)

 with a basic interface for programming DCC decoders, but it requires that you connect to the 

:doc:`/ex-toolbox/index` can program decoders over WiFi or Ethernet.

:doc:`/throttles/software/engine-driver` can program decoders over WiFi or Ethernet.

:doc:`/throttles/software/rtdrive-dccpp` can program decoders but it is not particularly user friendly to do so.

 can program decoders but it is not particularly user friendly to do so.

We also recommend using |JMRi| DecoderPro for programming decoders.  It works for USB connected a |EX-CS| and it provides plain English descriptions of all the CVs of a huge number of different decoders, is very well supported, runs on the major PC operating systems, and is free and open source.

 DecoderPro for programming decoders.  It works for USB connected a 

 and it provides plain English descriptions of all the CVs of a huge number of different decoders, is very well supported, runs on the major PC operating systems, and is free and open source.

Programming on the programming track, or service mode programming, allows for receiving acknowledgement that programming changes have successfully been applied, and also allows |JMRI| DecoderPro to interrogate a decoder to make a best guess at the type of decoder that's installed, what the address is, and so forth.

Programming on the programming track, or service mode programming, allows for receiving acknowledgement that programming changes have successfully been applied, and also allows 

 DecoderPro to interrogate a decoder to make a best guess at the type of decoder that’s installed, what the address is, and so forth.

Programming on main, also known as POM or ops mode programming, doesn't allow for acknowledgement or reading of CVs, but is handy when simple changes need to be made while a loco is in operation.

Programming on main, also known as POM or ops mode programming, doesn’t allow for acknowledgement or reading of CVs, but is handy when simple changes need to be made while a loco is in operation.

We will outline how to use each option below to update a locomotive DCC decoder's address, as well as identify a loco that is currently on the programming track.

We will outline how to use each option below to update a locomotive DCC decoder’s address, as well as identify a loco that is currently on the programming track.

Service mode programming is the preferred method for making wholesale changes to decoder settings as you will receive positive feedback that changes have been made and, if you make a mistake with a DCC address, you can quickly read what has been programmed to correct the issue, or reset them to factory default settings and start again.

To program any other features, refer to the `DecoderPro user guide <https://www.jmri.org/help/en/html/apps/DecoderPro/index.shtml>`_ |EXTERNAL-LINK|.

`DecoderPro user guide <https://www.jmri.org/help/en/html/apps/DecoderPro/index.shtml>`_

|JMRI| is a PC based app that runs on Windows, Apple macOS, and Linux (including Raspberry Pi's Raspbian (RasPi)).

 is a PC based app that runs on Windows, Apple macOS, and Linux (including Raspberry Pi’s Raspbian (RasPi)).

It relies on the |EX-CS| being connected to the PC running |JMRI|, normally by the USB cable. (It can be done over WiFi, but is not recommended).  This means that, even if you setup your |EX-CS| for WiFi you will need to connect it to the PC.  Don't worry, this will work without having to load the software on the |EX-CS| again.

, normally by the USB cable. (It can be done over WiFi, but is not recommended).  This means that, even if you setup your 

 for WiFi you will need to connect it to the PC.  Don’t worry, this will work without having to load the software on the 

To install |JMRi|, refer to the installation instructions on the `JMRI <https://www.jmri.org/help/en/manual/DecoderPro3/Installing_JMRI.shtml>`_ |EXTERNAL-LINK| website.

Once |JMRi| is installed, launch DecoderPro. If you haven't previously used DecoderPro or any |JMRi| applications, you will need to setup your |EX-CS| connection. Refer to the `JMRi help page <https://www.jmri.org/help/en/html/hardware/dccpp/index.shtml>`_ |EXTERNAL-LINK| for instructions on how to accomplish this.

 is installed, launch DecoderPro. If you haven’t previously used DecoderPro or any 

`JMRi help page <https://www.jmri.org/help/en/html/hardware/dccpp/index.shtml>`_

At this point, DecoderPro will be open at the "Getting Started" screen, assuming you have not used it before, and have no roster entries defined. The loco to be programmed also must be placed on your programming track.

At this point, DecoderPro will be open at the “Getting Started” screen, assuming you have not used it before, and have no roster entries defined. The loco to be programmed also must be placed on your programming track.

This is the process to create your first roster entry and set the desired DCC decoder address:

Click the :guilabel:`New Loco` button on the menu bar at the top of the screen

Click the :guilabel:`Read type from decoder` button at the bottom of the screen

The most appropriate decoder should automatically be detected and selected automatically (multiple matches may be made, so select the most appropriate)

Once only one decoder is selected, the "Create Basic Roster Entry" pane should appear to the right of the decoder list

Once only one decoder is selected, the “Create Basic Roster Entry” pane should appear to the right of the decoder list

Enter the desired name in "Roster ID", enter the desired DCC address in the "Active Address" box, then click the :guilabel:`Write` button to write the new address to the decoder

Enter the desired name in “Roster ID”, enter the desired DCC address in the “Active Address” box, then click the 

An "OK" should appear in the bottom left corner to indicate the write was successful

An “OK” should appear in the bottom left corner to indicate the write was successful

Click :guilabel:`Save` to save your roster entry, and then either close the window or repeat the process for other locos

 to save your roster entry, and then either close the window or repeat the process for other locos

Once your roster entries are populated, if you forget which loco was programmed with what, place your loco on the programming track and click the :guilabel:`Identify` button on the top menu. DecoderPro will detect the decoder settings and, if they match an existing roster entry, this will be displayed.

Once your roster entries are populated, if you forget which loco was programmed with what, place your loco on the programming track and click the 

 button on the top menu. DecoderPro will detect the decoder settings and, if they match an existing roster entry, this will be displayed.

To make further programming changes to your decoders, simply select the roster entry, make sure "Programming Track" is selected in the bottom right corner, then click the :guilabel:`Program` button which will open the full programming dialogue window.

To make further programming changes to your decoders, simply select the roster entry, make sure “Programming Track” is selected in the bottom right corner, then click the 

For further information on programming in service mode, see `Service Mode Programmer <https://www.jmri.org/help/en/manual/DecoderPro3/Programmer_ServiceMode.shtml>`_ |EXTERNAL-LINK| on the |JMRi| website.

`Service Mode Programmer <https://www.jmri.org/help/en/manual/DecoderPro3/Programmer_ServiceMode.shtml>`_

If you wish to set up a new roster entry for a loco that is already on your main track, or you don't have a programming track available, to a limited extent you can still do this through DecoderPro. You will, however, receive no acknowledgement that the changes have been written successfully.

If you wish to set up a new roster entry for a loco that is already on your main track, or you don’t have a programming track available, to a limited extent you can still do this through DecoderPro. You will, however, receive no acknowledgement that the changes have been written successfully.

This is the process to add a roster entry and set the desired DCC address:

Using POM only changes the loco you have selected, not all locos on the track.  Which is why you must select a loco first.  (Unlike the programming track where it changes everything on it)

You can theoretically change the DCC address using POM, but *only short addresses* (below 127) and some decoders don't even allow that.

Use the :guilabel:`Power` button at the top of the window to turn track power on

Unlike the service mode process above, you will need to manually select which decoder is installed in the loco

Once the decoder is selected, the "Create Basic Roster Entry" pane should appear to the right of the decoder list

Once the decoder is selected, the “Create Basic Roster Entry” pane should appear to the right of the decoder list

Enter the desired name in "Roster ID", enter the current DCC address in the "Active Address" box, then click the :guilabel:`Save` to save your roster entry, then close the "New Loco" window

Enter the desired name in “Roster ID”, enter the current DCC address in the “Active Address” box, then click the 

To set the desired DCC address, select the correct roster entry  *(See Warning)*

To set the desired DCC address, select the correct roster entry  

Select "Programming on Main", then click the :guilabel:`Program` button

Click the "Basic" tab, set the desired DCC address in the "Active Address" text box, then click the :guilabel:`Write changes on sheet` button  *(See Warning)*

Click the “Basic” tab, set the desired DCC address in the “Active Address” text box, then click the 

Close the "Program" window and when prompted, click the :guilabel:`Save and close` button

For further information on programming on the main track, see `Ops Mode Programming <https://www.jmri.org/help/en/manual/DecoderPro3/Programmer_OpsMode.shtml>`_ |EXTERNAL-LINK| on the |JMRi| website.

`Ops Mode Programming <https://www.jmri.org/help/en/manual/DecoderPro3/Programmer_OpsMode.shtml>`_

`LOW - Stage 1 <https://github.com/DCC-EX/dcc-ex.github.io/issues/415>`_

`LOW - VL53L0X <https://github.com/DCC-EX/dcc-ex.github.io/issues/447>`_ |EXTERNAL-LINK| - validate VL53L0X works with EXRAIL's analogue sensor commands ATGTE, ATLT, IFGTE, IFLT

DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.

  <a href="../../../index.html"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a>

  <a href="../../../ex-commandstation/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>

  <a href="../../../reference/hardware/motorboards/ex-motor-shield-8874.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;WiFiShield 8874</span></a>

  <a href="../../../ex-webthrottle/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;WebThrottle</span></a>

  <a href="../../../exrail/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">RAIL</span></a>

<a href="../../../exrail/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">RAIL</span></a>

  <a href="../../../ex-installer/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Installer</span></a>

  <a href="../../../ex-turntable/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Turntable</span></a>

  <a href="../../../ex-fastclock/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;FastClock</span></a>

  <a href="../../../ex-dccinspector/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;DCCInspector</span></a>

  <a href="../../../ex-ioexpander/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;IOExpander</span></a>

  <a href="../../../ex-toolbox/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Toolbox</span></a>

  <a href="../../../reference/hardware/motorboards/ex-motor-shield-8874.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;MotorShield8874</span></a>

  <a href="../../../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation&thinsp;/&thinsp;Booster One Express</span></a>

<a href="../../../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation&thinsp;/&thinsp;Booster One Express</span></a>

  <a href="../../../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CSB1</span></a>

  <a href="../../../throttles/native-protocol-library.html"><span class="dccex-suffix">DCCEX</span><span class="dccex-prefix">Protocol</span></a>

      :target: ../../../ex-commandstation/rtr-index.html

      :target: ../../../ex-commandstation/diy/index.html

      :target: ../../../ex-commandstation/index.html

      :target: ../../../ex-installer/index.html

      :target: ../../../ex-webthrottle/index.html

      :target: ../../../exrail/index.html

      :target: ../../../ex-turntable/index.html

      :target: ../../../ex-fastclock/index.html

      :target: ../../../ex-dccinspector/index.html

      :target: ../../../ex-ioexpander/index.html

      :target: ../../../download/ex-commandstation.html#getting-basestation-classic

      :target: ../../../ex-toolbox/index.html

      :target: ../../../reference/hardware/motorboards/ex-motor-shield-8874.html

      :target: ../../../trackmanager/index.html

      :alt: New in Version 5
      :target: ../../../news/posts/20230807.html

      :alt: New in Version 5.4

   :target: ../../../about/contributing/donate.html

   :target: ../../../begin/levels.html#conductor

   :target: ../../../begin/levels.html#tinkerer

   :target: ../../../begin/levels.html#engineer

   :class: image-min-width-144

   <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../../begin/levels.html#conductor">Conductor</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../../begin/levels.html#conductor">Conductor</a>

   <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../../begin/levels.html#tinkerer">Tinkerer</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../../begin/levels.html#tinkerer">Tinkerer</a>

   <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../../begin/levels.html#engineer">Engineer</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../../begin/levels.html#engineer">Engineer</a>

   :target: ../../../begin/levels.html#levels-of-difficulty-or-technical-complexity

   <a href="../../../support/index.html#contact-support-options" title="Request help or support"><img src="../../../_static/images/buttons/support.png" style="height: 33px;" /></a>

<a href="../../../support/index.html#contact-support-options" title="Request help or support"><img src="../../../_static/images/buttons/support.png" style="height: 33px;" /></a>

   <a href="../../../support/index.html#contact-support-options" title="Request help or support"><img src="../../../_static/images/buttons/support.png" style="width: 10%; height: 10%;" /></a>

<a href="../../../support/index.html#contact-support-options" title="Request help or support"><img src="../../../_static/images/buttons/support.png" style="width: 10%; height: 10%;" /></a>

  <img src="../../../_static/images/external-link.svg" style="width: 16px; height: 16px; margin-top: -3px;">

<img src="../../../_static/images/external-link.svg" style="width: 16px; height: 16px; margin-top: -3px;">

   <a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

  <a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

  <a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a class="githublink" href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

<a class="githublink" href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

   <a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

<a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

   <a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

   <a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

  <a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

  <a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

  <a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

  <a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

[comment] this adds a generic HTML meta *description* to the page.  You can alternately make use of one of the other include files,or create a new one, to have different description for the page.  DO NOT use both this and an alternate on the same page.

Time of Flight (or ToF) sensors can provide a more reliable and accurate sensor than traditional IR sensors as they are not susceptible to interference from different and varying lighting conditions.

Further to this, these sensors can be programmed to activate only within a specific distance range, enabling a large variety of use cases.

|EX-CS| has support for the VL53L0X ToF sensor via the "IO_VL53L0X.h" HAL device driver which connects to the |I2C| bus of the CommandStation.

 has support for the VL53L0X ToF sensor via the “IO_VL53L0X.h” HAL device driver which connects to the 

.. image:: /_static/images/vl53l0x/vl53l0x.jpg
  :alt: VL53L0X sensor
  :scale: 25%

.. image:: /_static/images/vl53l0x/adafruit-vl53l0x.jpg
  :alt: Adafruit VL53L0X sensor

The VL53L0X Time-Of-Flight sensor operates by sending a short laser pulse and detecting the reflection of the pulse.  The time between the pulse and the receipt of reflections is measured and used to determine the distance to the reflecting object.

For economy of memory and processing time, this driver includes only part of the code that ST provide in their API.  Also, the API code isn't very clear and it is not easy to identify what operations are useful and what are not. The operation shown here doesn't include any calibration, so is probably not as accurate as using the full driver, but it's probably accurate enough for the purpose.

For economy of memory and processing time, this driver includes only part of the code that ST provide in their API.  Also, the API code isn’t very clear and it is not easy to identify what operations are useful and what are not. The operation shown here doesn’t include any calibration, so is probably not as accurate as using the full driver, but it’s probably accurate enough for the purpose.

Each VL53L0X device will, by default, reside on the same |I2C| address of 0x29, and therefore connecting multiple devices to the same |I2C| bus requires consideration and planning.

 address of 0x29, and therefore connecting multiple devices to the same 

Connecting a single device is a simple matter of connecting the SDA and SCL pins to the SDA and SCL pins of your |EX-CS|, or your |I2C| bus if you have multiple other devices connected.

Connecting a single device is a simple matter of connecting the SDA and SCL pins to the SDA and SCL pins of your 

If the device's XSHUT pin is not connected, then it is very prone to noise, and the device may even reset when handled.  If you're not using XSHUT, then it's best to tie it to +5V.

If the device’s XSHUT pin is not connected, then it is very prone to noise, and the device may even reset when handled.  If you’re not using XSHUT, then it’s best to tie it to +5V.

Once connected, you will need to configure the device driver as per :ref:`ex-commandstation/accessories/sensors/vl53l0x-tof-sensor:configuring a single device`.

Once connected, you will need to configure the device driver as per 

:ref:`ex-commandstation/accessories/sensors/vl53l0x-tof-sensor:configuring a single device`

.. image:: /_static/images/vl53l0x/mega2560-single-vl53l0x.png
  :alt: Mega2560 with VL53L0X

Connecting multiple devices also require connecting each device to the SDA and SCL pins, however in addition to this, you will need to connect each device's XSHUT pin to an available I/O pin either directly on your |EX-CS|, or to an available I/O pin on an I/O expander such as an MCP23017. The XSHUT pin connection is required in order to be able to have each device addressed separately.

Connecting multiple devices also require connecting each device to the SDA and SCL pins, however in addition to this, you will need to connect each device’s XSHUT pin to an available I/O pin either directly on your 

, or to an available I/O pin on an I/O expander such as an MCP23017. The XSHUT pin connection is required in order to be able to have each device addressed separately.

Once connected, you will need to configure the device driver for each device as per :ref:`ex-commandstation/accessories/sensors/vl53l0x-tof-sensor:configuring multiple devices`.

Once connected, you will need to configure the device driver for each device as per 

.. image:: /_static/images/vl53l0x/mega2560-dual-vl53l0x.png
  :alt: Mega2560 two VL53L0Xs

Configuring support for one or more VL53L0X devices requires modifying "myHal.cpp" to include the device driver "IO_VL53L0X.h" and add an entry for each device to be configured.

Configuring support for one or more VL53L0X devices requires modifying “myHal.cpp” to include the device driver “IO_VL53L0X.h” and add an entry for each device to be configured.

A digital read on the first pin will return a value that indicates whether an object is within the threshold range, and the return value will be 1 for true, or 0 for false

An analogue read on the first pin returns the last measured distance (in mm)

An analogue read on the third pin returns detected ambient light level

By default, the device takes around 60ms to complete a ranging operation, so we do a 100ms cycle (10 samples per second).

The VL53L0X is initially set to respond to |I2C| address 0x29.  If you only have one module, you can use this address. However, the address can be modified by software.  If you select another address, that address will be written to the device and used until the device is reset.

 address 0x29.  If you only have one module, you can use this address. However, the address can be modified by software.  If you select another address, that address will be written to the device and used until the device is reset.

To enable support for one or more devices, ensure the "IO_VL53L0X.h" device driver is included at the beginning of your "myHal.cpp" file:

To enable support for one or more devices, ensure the “IO_VL53L0X.h” device driver is included at the beginning of your “myHal.cpp” file:

#if !defined(IO_NO_HAL)

// Include devices you need.
#include "IODevice.h"
#include "IO_VL53L0X.h"   // Laser time-of-flight sensor
...

For a single device, you need a single entry to create the device also in "myHal.cpp":

For a single device, you need a single entry to create the device also in “myHal.cpp”:

...

void halSetup() {
  VL53L0X::create(firstVpin, nPins, i2cAddress, lowThreshold, highThreshold);
  ...

i2cAddress is the |I2C| address of the device (normally 0x29 - should be no need to change this for a single device)

 address of the device (normally 0x29 - should be no need to change this for a single device)

lowThreshold is the distance at which the digital vpin state is set to 1 (in mm)

highThreshold is the distance at which the digital vpin state is set to 0 (in mm)

For example, this entry configures a device on vpin 4000 using the default address of 0x29. A digital read of this vpin will return a 1 if an object is within 200mm, and will return a 0 if an object moves more than 250mm from the sensor:

...

  VL53L0X::create(4000, 3, 0x29, 200, 250);
  ...

When using multiple devices, do not configure any device to use the default |I2C| address of 0x29, as this address needs to be free in order to configure each device on startup.

When using multiple devices, do not configure any device to use the default 

 address of 0x29, as this address needs to be free in order to configure each device on startup.

If you have more than one module, then you will need to specify a digital vpin (Arduino digital output or I/O expander pin) which you connect to the module's XSHUT pin.  When the device driver starts, the XSHUT pin is set LOW to turn the module off.  Once all VL53L0X modules are turned off, the driver works through each module in turn by setting XSHUT to HIGH to turn the module on, then writes the module's desired |I2C| address. In this way, many VL53L0X modules can be connected to the one |I2C| bus, each one using a distinct |I2C| address.

If you have more than one module, then you will need to specify a digital vpin (Arduino digital output or I/O expander pin) which you connect to the module’s XSHUT pin.  When the device driver starts, the XSHUT pin is set LOW to turn the module off.  Once all VL53L0X modules are turned off, the driver works through each module in turn by setting XSHUT to HIGH to turn the module on, then writes the module’s desired 

 address. In this way, many VL53L0X modules can be connected to the one 

Each device needs its own specific entry in "myHal.cpp", and requires an additional argument to specify the digital vpin that connects to the device's XSHUT pin.

Each device needs its own specific entry in “myHal.cpp”, and requires an additional argument to specify the digital vpin that connects to the device’s XSHUT pin.

...

  VL53L0X::create(firstVpin, nPins, i2cAddress, lowThreshold, highThreshold, xshutPin);
  ...

i2cAddress is the address of the device (normally 0x29 - should be no need to change this for a single device)

xshutPin is the vpin number corresponding to either a direct I/O pin or an I/O pin on an I/O expander

For example, these entries configure two devices on vpins 4000 and 4003, with |I2C| addresses 0x30 and 0x31. The device at 0x30 is connected directly to an Arduino Mega2560's digital pin 22, and the device at 0x31 is connected to the first digital I/O pin of the first MCP23017 device at vpin 164. A digital read of each of the device's vpins will return a 1 if an object is within 200mm, and will return a 0 if an object moves more than 250mm from the sensor:

For example, these entries configure two devices on vpins 4000 and 4003, with 

 addresses 0x30 and 0x31. The device at 0x30 is connected directly to an Arduino Mega2560’s digital pin 22, and the device at 0x31 is connected to the first digital I/O pin of the first MCP23017 device at vpin 164. A digital read of each of the device’s vpins will return a 1 if an object is within 200mm, and will return a 0 if an object moves more than 250mm from the sensor:

Note the second sensor starts at vpin 4003 as the first sensor consumes vpins 4000, 4001, and 4002.

...

  VL53L0X::create(4000, 3, 0x30, 200, 250, 22);
  VL53L0X::create(4003, 3, 0x31, 200, 250, 164);
  ...

If you are using |JMRi| and require these to be available as sensors, then they can be configured via the DCC-EX ``<Z id vpin iflag>`` command.

 and require these to be available as sensors, then they can be configured via the DCC-EX 

To create sensors for our examples above, the commands would be as shown below, and for simplicity we keep the sensor ID the same as the vpin ID in use.

With these definitions, when an object comes within 200mm of the sensors, a ``<Q id>`` message will be sent to all defined serial ports with the appropriate sensor ID:

With these definitions, when an object comes within 200mm of the sensors, a 

 message will be sent to all defined serial ports with the appropriate sensor ID:

Conversely, when an object moves more than 250mm from the sensors, a ``<q id>`` message will be sent instead:

Conversely, when an object moves more than 250mm from the sensors, a 

To ensure sensors are defined at startup, refer to :doc:`/ex-commandstation/advanced-setup/startup-config`.

|EX-R| enables utilising these devices as both digital and analogue sensors.

 enables utilising these devices as both digital and analogue sensors.

Using the standard digital sensor commands (AT, AFTER, ATTIMEOUT, IF, IFNOT, IFTIMEOUT) operates as per any other digital sensor, using the ranges specified when configuring the devices.

AT(4000)        // Will trigger when an object is within 200mm
AFTER(4003)     // Will trigger 0.5s after an object moves 250mm away

Using a VL53L0X with EXRAIL's analogue sensor commands has not been validated, this may not work.

Using a VL53L0X with EXRAIL’s analogue sensor commands has not been validated, this may not work.

With |EX-R|, you can also use the analogue sensor commands (ATGTE, ATLT, IFGTE, IFLT) to have automation based on the actual distance from the sensor, rather than it operating like a simple on/off switch.

, you can also use the analogue sensor commands (ATGTE, ATLT, IFGTE, IFLT) to have automation based on the actual distance from the sensor, rather than it operating like a simple on/off switch.

ATGTE(4000, 150)    // Will trigger when an object is 150mm or further away from the sensor
ATLT(4003, 100)     // Will trigger when an object is less than 100mm away

`LOW - VL53L0X <https://github.com/DCC-EX/dcc-ex.github.io/issues/447>`_

 - validate VL53L0X works with EXRAIL’s analogue sensor commands ATGTE, ATLT, IFGTE, IFLT

Solenoid/coil based turnouts are switched by very small coils that are typically designed to be energised for very brief periods of time (read milliseconds, not seconds), and **leaving these energised for too long will burn them out**.

Solenoid/coil based turnouts are switched by very small coils that are typically designed to be energised for very brief periods of time (read milliseconds, not seconds), and 

If not using the manufacturer's turnout/point control hardware, the safest option is to use a capacitive discharge unit (CDU), as the short duration discharge of the capacitor is what is used to energise the coil.

If not using the manufacturer’s turnout/point control hardware, the safest option is to use a capacitive discharge unit (CDU), as the short duration discharge of the capacitor is what is used to energise the coil.

If switching the points digitally via some other means such as a motor driver IC or relay, use the shortest duration that provides reliable switching.

To define solenoid/coil based turnouts directly in your |EX-CS| via the serial console, use the appropriate one of these commands:

 via the serial console, use the appropriate one of these commands:

``<T id VPIN vpin>`` - use this command when using a turnout/point controller that uses a single pin, whether connected directly to your |EX-CS| or via an I/O expander device

 - use this command when using a turnout/point controller that uses a single pin, whether connected directly to your 

``<T id DCC linear_address>`` - use this command when using DCC accessory decoders to control the turnout/point

 - use this command when using DCC accessory decoders to control the turnout/point

Refer to :ref:`reference/software/command-summary-consolidated:turnouts/points (configuring the ex-commandstation)` for details on these commands.

:ref:`reference/software/command-summary-consolidated:turnouts/points (configuring the ex-commandstation)`

To define solenoid/coil based turnouts using |EX-R| (whether or not they are to be automated) via the "myAutomation.h" file, use the appropriate one of these commands:

 (whether or not they are to be automated) via the “myAutomation.h” file, use the appropriate one of these commands:

``PIN_TURNOUT(id, vpin [, "description"])`` - use this command when using a turnout/point controller that uses a single pin, whether connected directly to your |EX-CS| or via an I/O expander device

``VIRTUAL_TURNOUT(id [, "description"])`` - use this command when you need to define a custom macro that controls the various pins and duration required to switch a turnout

 - use this command when you need to define a custom macro that controls the various pins and duration required to switch a turnout

``TURNOUT(id, addr, sub_addr [, "description"])`` - use this command when using DCC accessory decoders to control the servos

 - use this command when using DCC accessory decoders to control the servos

Refer to :ref:`exrail/exrail-command-reference:turnout/point objects - definition and control` for details on these commands, along with :ref:`exrail/creating-elements:adding turnouts/points` for some further information and examples.

:ref:`exrail/exrail-command-reference:turnout/point objects - definition and control`

.. image:: /_static/images/turnouts/bare-l293d-single-coil-turnouts.png
  :alt: Bare L293D with single coil turnouts
  :scale: 30%

A single L293D motor driver IC can be used to control two turnouts/points and will require six digital output pins either directly from your |EX-CS| (as per the diagram above), or these can also be connected via an I/O expander such as an MCP23017 or |EX-IO|.

A single L293D motor driver IC can be used to control two turnouts/points and will require six digital output pins either directly from your 

 (as per the diagram above), or these can also be connected via an I/O expander such as an MCP23017 or 

To operate the turnouts/points in this manner, the direction of the turnout (close/throw) is configured by setting the input pins (2 and 7, 10 and 15) high or low, and briefly setting the appropriate enable pin high (1 or 9).

Note that the 10K pull down resistors connected from ground to the enable pins are there as a safety feature to ensure that any unknown states during start up don't cause the enable pins to be set to a high state, causing the coils to overheat and burn out.

Note that the 10K pull down resistors connected from ground to the enable pins are there as a safety feature to ensure that any unknown states during start up don’t cause the enable pins to be set to a high state, causing the coils to overheat and burn out.

The voltage provided to "External Power" is the voltage required to operate the turnouts/points, and will depend on the brand/model. Absolute maximum for the L293D is 36V DC.

The voltage provided to “External Power” is the voltage required to operate the turnouts/points, and will depend on the brand/model. Absolute maximum for the L293D is 36V DC.

Here is an example |EX-R| macro that will configure a virtual turnout, setting the correct pins for the two turnouts to operate correctly:

 macro that will configure a virtual turnout, setting the correct pins for the two turnouts to operate correctly:

#define PULSE 10    // Set the duration of the pulse to 10ms
#define SINGLE_COIL_TURNOUT(t, p1, p2, p3, desc) \
VIRTUAL_TURNOUT(t, desc) \
DONE \
ONCLOSE(t) \
 SET(p2) RESET(p3) \
 SET(p1) DELAY(PULSE) RESET(p1) \
DONE \
ONTHROW(t) \
 RESET(p2) SET(p3) \
DONE

SINGLE_COIL_TURNOUT(101, 22, 24, 26, "Turnout 101")
SINGLE_COIL_TURNOUT(102, 23, 25, 27, "Turnout 102")

Before implementing this macro (or any similar macro controlling solenoid/coil turnouts/points), it is imperative that the correct voltage for the brand and model of turnouts/points is known, and that the defined pulse or delay time is kept to the minimum value possible for reliable switching of the turnouts/points.

.. image:: /_static/images/turnouts/bare-l293d-dual-coil-turnouts.png
  :alt: Bare L293D with dual coil turnouts

Like the single solenoid/coil turnouts, a single L293D motor driver IC can be used to control two turnouts/points. This will still require six digital output pins either directly from your |EX-CS| (as per the diagram above), or these can also be connected via an I/O expander such as an MCP23017 or |EX-IO|.

Like the single solenoid/coil turnouts, a single L293D motor driver IC can be used to control two turnouts/points. This will still require six digital output pins either directly from your 

To operate the turnouts/points in this manner, the direction of the turnout (close/throw) is still configured by setting the input pins (2 and 7, 10 and 15) high or low, and briefly setting the appropriate enable pin high (1 or 9). The key difference for dual solenoid/coil turnouts is the common (third) wire of the turnout being connected to ground as per the diagram above.

Here is an example |EX-R| macro that will configure a virtual turnout, setting the correct pins for the two turnouts to operate correctly (note it is identical to the single coil version, but renamed):

 macro that will configure a virtual turnout, setting the correct pins for the two turnouts to operate correctly (note it is identical to the single coil version, but renamed):

#define DUAL_COIL_TURNOUT(t, p1, p2, p3, desc) \
DONE \
DONE \
 ONTHROW(t) \
DONE

DUAL_COIL_TURNOUT(101, 22, 24, 26, "Turnout 101")
DUAL_COIL_TURNOUT(102, 23, 25, 27, "Turnout 102")

using a capacitive discharge unit (cdu) - single solenoid/coil turnouts

The information here is based on the combined driver and CDU as outlined in this GitHub repository, with a PCB available from `PCBWay <https://www.pcbway.com/>`_ |EXTERNAL-LINK|

The information here is based on the combined driver and CDU as outlined in this GitHub repository, with a PCB available from 

`DCC Solenoid Turnout Driver <https://github.com/Rosscoetrain/DCC-Solenoid-Turnout-Driver>`_ |EXTERNAL-LINK|

`DCC Solenoid Turnout Driver <https://github.com/Rosscoetrain/DCC-Solenoid-Turnout-Driver>`_

.. image:: /_static/images/turnouts/block_diagram_switch_final.png
  :alt: Block Diagram
  :scale: 60%

This board has an MCP23017 which is connected to your |EX-CS| via |I2C|, which is then controlled like any other MCP23017.  This MCP23017 controls two ULN2803 darlington arrays to switch power to the turnout/point solenoids.

, which is then controlled like any other MCP23017.  This MCP23017 controls two ULN2803 darlington arrays to switch power to the turnout/point solenoids.

On the turnout/point solenoids, there will be three wires: a common wire, a wire to close the turnout, and a wire to throw the turnout.

With the above driver board, the common is positive and the control wires are connected to ground by the darlington drivers.

The |EX-R| macro below creates a turnout object that closes/throws the turnout/point via the MCP23017 vpins on the board.

 macro below creates a turnout object that closes/throws the turnout/point via the MCP23017 vpins on the board.

#define PULSE 10 //10 mSec
#define DUAL_SOLENOID_TURNOUT(id,pc,pt,desc,ali) \
VIRTUAL_TURNOUT(id,desc) \
ALIAS(ali,id) \
DONE \
ONCLOSE(id) \
 SET(pc) \
 DELAY(PULSE) \
 RESET(pc) \
DONE \
ONTHROW(id) \
 SET(pt) \
 RESET(pt) \
DONE

// Example use of this macro using first two pins on the first MCP23017 I/O expander
DUAL_SOLENOID_TURNOUT(1,164,165,"Example CDU turnout",EXAMPLE_TURNOUT)

using a capacitive discharge unit (cdu) - dual solenoid/coil turnouts

A Tortoise is still a solenoid turnout/point motor that need a voltage applied for a certain amount of time and to reverse polarity to go in the other direction. They implement it as a stall motor, which means if you were willing to waste 15-20mA of current at idle, you can use a switch and it just stalls out at the end of travel. But now we get into the weeds about all the different ways you can control your Tortoise. The issue is that a command station can't directly control things that require a lot of current or voltages higher than 5V or on the CSB1 3.3V. So we control a switch of some kind, like a relay or transistor, that CAN handle that load.

A Tortoise is still a solenoid turnout/point motor that need a voltage applied for a certain amount of time and to reverse polarity to go in the other direction. They implement it as a stall motor, which means if you were willing to waste 15-20mA of current at idle, you can use a switch and it just stalls out at the end of travel. But now we get into the weeds about all the different ways you can control your Tortoise. The issue is that a command station can’t directly control things that require a lot of current or voltages higher than 5V or on the CSB1 3.3V. So we control a switch of some kind, like a relay or transistor, that CAN handle that load.

The easiest solution costs you $60 from Jack Reagan at :doc:`Smart Hobby LLC </purchasing/dealers>` which buys you a 16 output capacitive discharge board. You connect it to the I2C port on the CSB1, then a simple |EX-R| script he supplies goes in your myAutomation.h file and you are done. The turnouts/points would appear on an |ED| or |JMRI| and you just ``THROW`` and ``CLOSE`` them.

 which buys you a 16 output capacitive discharge board. You connect it to the I2C port on the CSB1, then a simple 

 script he supplies goes in your myAutomation.h file and you are done. The turnouts/points would appear on an 

You can add sensors and have the turnouts/points controlled by the route you want your trains to follow. Benefit here is that the Smart Hobby CS board can also control snap switches like Kato and any other single or dual coil switch machine that needs a strong, short, burst of energy. Jack also supports you so you can ask him the questions.

**Rosscoetrain** has a similar board and an accessory controller version. You define a ``DCC_TURNOUT`` and his controller does the rest since it acts like an 8 port DCC accessory decoder. It takes a DCC turnout command from the track. It also can control anything else that needs on/off power control such as LED lighting, motors, etc. Rosscoetrain also provides support.

 has a similar board and an accessory controller version. You define a 

 and his controller does the rest since it acts like an 8 port DCC accessory decoder. It takes a DCC turnout command from the track. It also can control anything else that needs on/off power control such as LED lighting, motors, etc. Rosscoetrain also provides support.

A simple but less easy method is to use a DPDT relay and a MCP23017 port expander board (dirt cheap and also connects to the I2C port) or our |EX-IO| software running on a cheap processor like an Uno or Nano or Elegoo Mega. Define each turnout as a PIN_TURNOUT. This wastes 15-20mA or more of current for each one all the time since the power never gets shutoff. The way around that is to use a motor driver board to act as a solid state relay. Transistors on the board and an |EX-R| script control both the polarity switching and the duration of the voltage. We have those simple scripts, so you don't need to know C++ or electronics to throw a turnout/point. People have used all sorts of inexpensive boards for this, including Rosscoetrain’s motor board which has 4 MOSFET transistors.

A simple but less easy method is to use a DPDT relay and a MCP23017 port expander board (dirt cheap and also connects to the I2C port) or our 

 software running on a cheap processor like an Uno or Nano or Elegoo Mega. Define each turnout as a PIN_TURNOUT. This wastes 15-20mA or more of current for each one all the time since the power never gets shutoff. The way around that is to use a motor driver board to act as a solid state relay. Transistors on the board and an 

 script control both the polarity switching and the duration of the voltage. We have those simple scripts, so you don’t need to know C++ or electronics to throw a turnout/point. People have used all sorts of inexpensive boards for this, including Rosscoetrain’s motor board which has 4 MOSFET transistors.

Regardless of which method you use, take a look at the documentation for |EX-IO| since it has a lot built into it. And you can connect the Smart Hobby board and a lot of other things to it.

Regardless of which method you use, take a look at the documentation for 

 since it has a lot built into it. And you can connect the Smart Hobby board and a lot of other things to it.

`LOW - Controllers <https://github.com/DCC-EX/dcc-ex.github.io/issues/416>`_ |EXTERNAL-LINK| - diagram needed for the connection via USB Cable

Throttles (apps and devices) that can be used on EX-CommandStations. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

  <a href="../../index.html"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a>

<a href="../../index.html"><span class="dccex-suffix">DCC-</span><span class="dccex-prefix">EX</span></a>

  <a href="../../ex-commandstation/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation</span></a>

  <a href="../../reference/hardware/motorboards/ex-motor-shield-8874.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;WiFiShield 8874</span></a>

  <a href="../../ex-webthrottle/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;WebThrottle</span></a>

  <a href="../../exrail/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">RAIL</span></a>

<a href="../../exrail/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">RAIL</span></a>

  <a href="../../ex-installer/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Installer</span></a>

  <a href="../../ex-turntable/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Turntable</span></a>

  <a href="../../ex-fastclock/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;FastClock</span></a>

  <a href="../../ex-dccinspector/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;DCCInspector</span></a>

  <a href="../../ex-ioexpander/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;IOExpander</span></a>

  <a href="../../ex-toolbox/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Toolbox</span></a>

<a href="../../ex-toolbox/index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;Toolbox</span></a>

  <a href="../../reference/hardware/motorboards/ex-motor-shield-8874.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;MotorShield8874</span></a>

  <a href="../../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation&thinsp;/&thinsp;Booster One Express</span></a>

<a href="../../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CommandStation&thinsp;/&thinsp;Booster One Express</span></a>

  <a href="../../ex-commandstation/rtr-index.html"><span class="ex-prefix">EX</span><span class="ex-suffix">&#8209;CSB1</span></a>

  <a href="../../throttles/native-protocol-library.html"><span class="dccex-suffix">DCCEX</span><span class="dccex-prefix">Protocol</span></a>

      :target: ../../ex-commandstation/rtr-index.html

      :target: ../../ex-commandstation/diy/index.html

      :target: ../../ex-commandstation/index.html

      :target: ../../ex-installer/index.html

      :target: ../../ex-webthrottle/index.html

      :target: ../../exrail/index.html

      :target: ../../ex-turntable/index.html

      :target: ../../ex-fastclock/index.html

      :target: ../../ex-dccinspector/index.html

      :target: ../../ex-ioexpander/index.html

      :target: ../../download/ex-commandstation.html#getting-basestation-classic

      :target: ../../ex-toolbox/index.html

      :target: ../../reference/hardware/motorboards/ex-motor-shield-8874.html

      :target: ../../trackmanager/index.html

      :target: ../../news/posts/20230807.html

   :target: ../../about/contributing/donate.html

   :target: ../../begin/levels.html#conductor

   :target: ../../begin/levels.html#tinkerer

   :target: ../../begin/levels.html#engineer

   <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../begin/levels.html#conductor">Conductor</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../begin/levels.html#conductor">Conductor</a>

   <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../begin/levels.html#tinkerer">Tinkerer</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../begin/levels.html#tinkerer">Tinkerer</a>

   <a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../begin/levels.html#engineer">Engineer</a>

<a style="font-weight: bold; font-style: italic; color: #00a3b9 !important;" href="../../begin/levels.html#engineer">Engineer</a>

   :target: ../../begin/levels.html#levels-of-difficulty-or-technical-complexity

   <a href="../../support/index.html#contact-support-options" title="Request help or support"><img src="../../_static/images/buttons/support.png" style="height: 33px;" /></a>

<a href="../../support/index.html#contact-support-options" title="Request help or support"><img src="../../_static/images/buttons/support.png" style="height: 33px;" /></a>

   <a href="../../support/index.html#contact-support-options" title="Request help or support"><img src="../../_static/images/buttons/support.png" style="width: 10%; height: 10%;" /></a>

<a href="../../support/index.html#contact-support-options" title="Request help or support"><img src="../../_static/images/buttons/support.png" style="width: 10%; height: 10%;" /></a>

  <img src="../../_static/images/external-link.svg" style="width: 16px; height: 16px; margin-top: -3px;">

<img src="../../_static/images/external-link.svg" style="width: 16px; height: 16px; margin-top: -3px;">

   <a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

  <a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

  <a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

<a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 169px;" /></a>

   <a class="githublink" href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

<a class="githublink" href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

   <a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

<a href="https://github.com/DCC-EX/Turntable-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 196px; height: 40px;" /></a>

   <a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/DCCInspector-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

   <a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/WebThrottle-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

  <a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/EX-Installer/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

  <a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/CommandStation-EX/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

  <a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

<a href="https://github.com/DCC-EX/EX-IOExpander/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>

  <a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>
  ..

<a href="https://github.com/DCC-EX/EX-FastClock/issues/new/choose" target="_blank" title="Create a bug report, request a new feature, or request help"><img src="../../_static/images/buttons/github-bug.png" style="width: 50%; height: 50%;" /></a>
..

You need just two things that work together to operate your model railroad:

The Command Station is covered in the :doc:`Getting Started <index>` section, and is usually an Arduino microcontroller and a motor driver. The Command Station accepts instructions from a controller and generates packets that are transmitted to your track.

 section, and is usually an Arduino microcontroller and a motor driver. The Command Station accepts instructions from a controller and generates packets that are transmitted to your track.

Since the Command Station simply accepts commands to turn into signals for your layout, you need something that sends those commands to run your trains - a controller. It isn't very practical to type something like <t 1 3 75 1> into a |serial monitor| to tell your train to move each time! 😉  A controller can be a hardware device like a handheld throttle (also called a Cab), an App that runs on your phone, a Web Page, or front-end software like |JMRI| or Rocrail that runs on a computer or Raspberry Pi.

Since the Command Station simply accepts commands to turn into signals for your layout, you need something that sends those commands to run your trains - a controller. It isn’t very practical to type something like <t 1 3 75 1> into a 

 to tell your train to move each time! 😉  A controller can be a hardware device like a handheld throttle (also called a Cab), an App that runs on your phone, a Web Page, or front-end software like 

Your controller can connect to the |EX-CS| several different ways, such as:

The most popular methods for connecting your throttle are with a USB cable, or wirelessly with WiFi or Bluetooth. Make sure to check the feature list to see if your controller uses the type of connection you prefer.

For those who just want to run trains and not use any other control software, the simplest method to get going is to download a compatible phone or tablet app and connect directly from your wireless device to the |EX-CS|. You need a Command Station with a WiFi Shield or other type of WiFi board, or a Bluetooth board and a throttle that supports Bluetooth. Here is an image that represents a direct connection.

For those who just want to run trains and not use any other control software, the simplest method to get going is to download a compatible phone or tablet app and connect directly from your wireless device to the 

. You need a Command Station with a WiFi Shield or other type of WiFi board, or a Bluetooth board and a throttle that supports Bluetooth. Here is an image that represents a direct connection.

.. image:: /_static/images/throttles/throttle_wifi_direct.png
   :alt:  WiFi Throttle Direct to Command Station
   :align: center
   :scale: 50%

An equally simple way to connect from your wireless device to the |EX-CS| is by connecting your command station to you home network. You need a Command Station with a WiFi Shield or other type of WiFi board. Here is an image that represents a indirect connection.

An equally simple way to connect from your wireless device to the 

 is by connecting your command station to you home network. You need a Command Station with a WiFi Shield or other type of WiFi board. Here is an image that represents a indirect connection.

.. image:: /_static/images/throttles/throttle_wifi_indirect.png
   :alt:  WiFi Throttle indirect to Command Station

For those who want the power of |JMRI| to operate a complex layout, you would install |JMRI| on a computer or Raspberry Pi and connect your throttle to |JMRI| wirelessly through its preferred method, usually the |WiThrottle Server| or Web Server Interface. Here is an image that shows connecting wirelessly to |JMRI|, and connecting |JMRI| via a USB cable to the Command Station.

 or Web Server Interface. Here is an image that shows connecting wirelessly to 

.. image:: /_static/images/throttles/throttle_wifi_jmri.png
   :alt:  WiFi Throttle to JMRI and JMRI to CS with USB cable

There are at least 3 ways for a throttle to 'talk' to a Command Station; the |DCC-EX Native Commands|, |WiThrottle Protocol| command language, and via the |JMRI| Web Server command language. For an explanation of what these terms mean, and what that means to you, please see :doc:`Protocols: WiThrottle, DCC-EX Native Commands, and Web Servers Explained </throttles/protocols>`. |EX-CS| natively understands our own |DCC-EX Native Commands| and the |WiThrottle Protocol| API, and will work with a direct connection to these throttles. However, you can connect throttles to the computer running |JMRI|, and use |JMRI| as the middleware to send commands to |EX-CS|. |JMRI| uses |DCC-EX Native Commands| when speaking to the Command Station.

There are at least 3 ways for a throttle to ‘talk’ to a Command Station; the 

 Web Server command language. For an explanation of what these terms mean, and what that means to you, please see 

:doc:`Protocols: WiThrottle, DCC-EX Native Commands, and Web Servers Explained </throttles/protocols>`

Protocols: WiThrottle, DCC-EX Native Commands, and Web Servers Explained

 API, and will work with a direct connection to these throttles. However, you can connect throttles to the computer running 

Here is a list of some of the throttles you can use with |EX-CS|. We work closely with developers to help them maintain compatibility with the |EX-CS|. Check back on occasion, as new devices are being added all the time.

. We work closely with developers to help them maintain compatibility with the 

. Check back on occasion, as new devices are being added all the time.

For more information on any of these throttles, you can click on their links below or see our :doc:`Throttles Page Index </throttles/index>`.

For more information on any of these throttles, you can click on their links below or see our 

The simplest option is to just use a throttle connected directly to the |EX-CS|. The simplest of all is arguably |EX-WT|, connected via a USB cable from your computer and web browser directly to the Command Station. You have control of multiple locomotives and can operate turnouts/points. There is a way to replace the USB cable with a wireless connection, but we will cover that later in the Wireless USB Bridge section. Below is a picture of |EX-WT| with the side menu open. You can click on the image to see it full size.

The simplest option is to just use a throttle connected directly to the 

, connected via a USB cable from your computer and web browser directly to the Command Station. You have control of multiple locomotives and can operate turnouts/points. There is a way to replace the USB cable with a wireless connection, but we will cover that later in the Wireless USB Bridge section. Below is a picture of 

 with the side menu open. You can click on the image to see it full size.

.. image:: /_static/images/throttles/webthrottle1.jpg
   :alt: EX-WebThrottle

Here are your connections, just a computer running a chromium-based browser, a USB cable, and your |EX-CS|.

Here are your connections, just a computer running a chromium-based browser, a USB cable, and your 

.. image:: /_static/images/throttles/webthrottle_setup.png
   :scale: 45%

For operating instructions see :doc:`how to use EX-WebThrottle </ex-webthrottle/index>`

There are many phone and tablet apps that can be used as throttles. Some of them connect directly to the |EX-CS|, while others connect to a computer running |JMRI|, which in turn connects to the Command Station via a USB cable. The following is a list of some of the most popular throttle apps that work with the |EX-CS|.

There are many phone and tablet apps that can be used as throttles. Some of them connect directly to the 

, which in turn connects to the Command Station via a USB cable. The following is a list of some of the most popular throttle apps that work with the 

Engine Driver uses either an interface called "|WiThrottle Protocol|" (for WiFi Throttle), or |DCC-EX Native Protocol| to connect to the |EX-CS| over WiFi. Any |WiThrottle Protocol| or |DCC-EX Native Protocol| compatible throttle will work with the |EX-CS|.

|Engine Driver| is a throttle app for your phone that can control multiple locos and your turnouts/points.

 is a throttle app for your phone that can control multiple locos and your turnouts/points.

The first method is by connecting directly to the Command Station via WiFi. You will need a WiFi board connected to the Command Station (see WiFi Setup :doc:`WiFi Setup </ex-commandstation/advanced-setup/supported-connections/wifi-setup>`).

The first method is by connecting directly to the Command Station via WiFi. You will need a WiFi board connected to the Command Station (see WiFi Setup 

The second method is to use |JMRI| and connect |Engine Driver| (ED) to the computer running |JMRI|. That computer would then connect to the Command Station via a USB cable (normally) or via a Wireless USB Bridge. The computer running |JMRI| can be just about any type of computer: PC, Mac, or Raspberry Pi. However, most operators like the Pi option because it is inexpensive, small, can mount under the layout, and has a free image file that you can flash to a Micro-SD card and have a full |JMRI| setup with WiFi with virtually no fuss.

. That computer would then connect to the Command Station via a USB cable (normally) or via a Wireless USB Bridge. The computer running 

 can be just about any type of computer: PC, Mac, or Raspberry Pi. However, most operators like the Pi option because it is inexpensive, small, can mount under the layout, and has a free image file that you can flash to a Micro-SD card and have a full 

See :doc:`Engine Driver Page </throttles/software/engine-driver>`

|WiThrottle| is an app for iPhones and iPads. It can connect directly to the |EX-CS| like |Engine Driver| does, or connect to |JMRI| on a computer and then have |JMRI| connect to the Command Station via a USB cable.

 is an app for iPhones and iPads. It can connect directly to the 

DCCpp CAB is a throttle that natively speaks the |DCC-EX Native Commands|. It can connect via WiFi or Bluetooth! If you don't need software like |JMRI| running on a computer, DCCpp CAB lets you connect directly to the |EX-CS|.

. It can connect via WiFi or Bluetooth! If you don’t need software like 

 running on a computer, DCCpp CAB lets you connect directly to the 

Locontrol is a beautiful and functional throttle that uses the |JMRI| Web Server to connect. Soon it will be able to connect directly to the |EX-CS| by using the |DCC-EX Native Commands| set.

 Web Server to connect. Soon it will be able to connect directly to the 

locontrol (ios | jmri web server, dcc-ex native commands | wifi)

This is the only throttle with a Windows App. It also has a beautiful user interface. Soon it will be able to speak directly to |EX-CS| using our command language.

This is the only throttle with a Windows App. It also has a beautiful user interface. Soon it will be able to speak directly to 

See :doc:`DigiTrainsPro Page </throttles/software/digitrainspro>`

digitrainspro (android, ios, windows | withrottle, dcc-ex native commands | wifi)

Operate up to 3 locos from your iOS device. It supports both |WiThrottle Protocol| AND the |DCC-EX Native Protocol|.

There are many other apps that can be used as throttles. See the :doc:`Throttles Page Index </throttles/index>` for a complete list of apps that work with the |EX-CS|.

There are many other apps that can be used as throttles. See the 

There are many Do-It-Yourself (DIY) and commercial hardware devices that can be used as throttles. Some of them connect directly to the |EX-CS|, while others connect to a computer running |JMRI|, which in turn connects to the Command Station via a USB cable.

There are many Do-It-Yourself (DIY) and commercial hardware devices that can be used as throttles. Some of them connect directly to the 

, which in turn connects to the Command Station via a USB cable.

See the :doc:`Throttles Page Index </throttles/index>` for a complete list of hardware devices that work with the |EX-CS|.

|JMRI| is sort of the 800lb gorilla of front-ends! In its simplest form, it is a throttle, or a gateway to allow you to use |Engine Driver|, or a mouse or touchscreen, as a throttle without a WiFi board connected to the |EX-CS|. The WiFi is built into the computer you use to run |JMRI|, and |JMRI| has a |WiThrottle Server| built into it. The computer running |JMRI|, in turn, connects to the Command Station with a USB cable. |JMRI| is a complex program. If you are seriously into your model railroading however, |JMRI| can provide a lot of value. It can handle your turnouts/points, outputs, and sensors. It lets you create rosters for your locos and a visual layout of your tracks. There isn't much it can't do. And it is free and open source, just like |DCC-EX|!

 is sort of the 800lb gorilla of front-ends! In its simplest form, it is a throttle, or a gateway to allow you to use 

, or a mouse or touchscreen, as a throttle without a WiFi board connected to the 

 is a complex program. If you are seriously into your model railroading however, 

 can provide a lot of value. It can handle your turnouts/points, outputs, and sensors. It lets you create rosters for your locos and a visual layout of your tracks. There isn’t much it can’t do. And it is free and open source, just like 

Probably the way most people use |JMRI| is to have a Raspberry Pi running |JMRI| connected via a short USB cable to the |EX-CS|. They then use |Engine Driver| on their phone, connected to |JMRI| via WiFi as a throttle for their engines. If you want to actually operate using all the features of |JMRI|, you can connect a small monitor, keyboard, and mouse to your computer or Raspberry Pi. You can replace the USB cable with a USB Wireless Bridge which is covered in that section. But let's look at another method next.

 via WiFi as a throttle for their engines. If you want to actually operate using all the features of 

, you can connect a small monitor, keyboard, and mouse to your computer or Raspberry Pi. You can replace the USB cable with a USB Wireless Bridge which is covered in that section. But let’s look at another method next.

VNC stands for "Virtual Network Computing", and it is a way to access a device remotely. Variations of this are called "Remote Desktop" in Windows, TeamViewer, AnyDesk, etc. It is free and it lets you take another device, like a tablet, and have a viewport into the computer you are using to run |JMRI|. It literally is a "remote desktop". Everything is running on your computer or Raspberry Pi, yet you can control it from a handheld wireless device with a touchscreen.

VNC stands for “Virtual Network Computing”, and it is a way to access a device remotely. Variations of this are called “Remote Desktop” in Windows, TeamViewer, AnyDesk, etc. It is free and it lets you take another device, like a tablet, and have a viewport into the computer you are using to run 

. It literally is a “remote desktop”. Everything is running on your computer or Raspberry Pi, yet you can control it from a handheld wireless device with a touchscreen.

`LOW - Controllers <https://github.com/DCC-EX/dcc-ex.github.io/issues/416>`_ |EXTERNAL-LINK| - diagram needed for Connecting via VNC

`LOW - Controllers <https://github.com/DCC-EX/dcc-ex.github.io/issues/416>`_

The USB Wireless Bridge is a pair of small, inexpensive devices that let you replace a USB cable with a wireless connection. You really could connect any two devices that would normally connect with a USB cable. The power of this system is that there is little or no configuration, and no changes need to be made to your controller or the CS. In our world, here are some of the ways you can use it:

Connect WebThrottle-EX running on a laptop or tablet wirelessly to the |EX-CS|

Connect WebThrottle-EX running on a laptop or tablet wirelessly to the 

Connect a computer or Raspberry Pi running |JMRI| (or another front-end) to the Command Station

Connect normally-tethered handheld cabs (throttles) wirelessly to the Command Station

`LOW - Controllers <https://github.com/DCC-EX/dcc-ex.github.io/issues/416>`_ |EXTERNAL-LINK| - diagram needed for USB Wireless Bridge

For more information about all the throttles, see the :doc:`Throttles Section </throttles/index>`>

It's also possible to connect a throttle or controller directly to the |EX-CS| serial port Tx/Rx pins if it uses a logic level serial connection. This would be a common option for DIY throttles based on other Arduino platforms.

It’s also possible to connect a throttle or controller directly to the 

 serial port Tx/Rx pins if it uses a logic level serial connection. This would be a common option for DIY throttles based on other Arduino platforms.

This is also the same method when using HC05/06 Bluetooth devices, as outlined in :doc:`/reference/hardware/bluetooth/hc-05-06`.

This is also the same method when using HC05/06 Bluetooth devices, as outlined in 

If connecting to serial ports other than the default (e.g. serial port 0 on the Mega2560), you will need to enable API commands for that specific serial port by editing your "config.h" file, and uncommenting the appropriate line. For example, to enable API commands on serial port 2, you need to uncomment this line:

If connecting to serial ports other than the default (e.g. serial port 0 on the Mega2560), you will need to enable API commands for that specific serial port by editing your “config.h” file, and uncommenting the appropriate line. For example, to enable API commands on serial port 2, you need to uncomment this line:

Once you have uploaded the software again with this defined in "config.h" and your throttle is connected correctly, it will be able to perform all normal throttle functions via serial port 2.

Once you have uploaded the software again with this defined in “config.h” and your throttle is connected correctly, it will be able to perform all normal throttle functions via serial port 2.

Outside of physical connectivity considerations outlined below, the throttle developer should provide whatever other information is necessary to connect and use their throttle with your |EX-CS|.

Outside of physical connectivity considerations outlined below, the throttle developer should provide whatever other information is necessary to connect and use their throttle with your 

If connecting directly to Arduino pin serial ports, you need to ensure that the logic levels are compatible between the |EX-CS| and throttle. A 5V microcontroller connecting to a 3.3V microcontroller will likely lead to damage for the 3.3V microcontroller., so care must be taken here.

If connecting directly to Arduino pin serial ports, you need to ensure that the logic levels are compatible between the 

 and throttle. A 5V microcontroller connecting to a 3.3V microcontroller will likely lead to damage for the 3.3V microcontroller., so care must be taken here.

A common microcontroller used for DIY throttles is the ESP32, which is a 3.3V device, so therefore care must be taken when connecting to a Mega2560 |EX-CS| as these are 5V devices.

A common microcontroller used for DIY throttles is the ESP32, which is a 3.3V device, so therefore care must be taken when connecting to a Mega2560 

A simple resistor divider using a 1K and 2K resistor can solve this problem as per the provided diagram. Note, also, that the Tx pin of the throttle must connect to the Rx pin of the |EX-CS|, and likewise the Rx pin to Tx pin.

A simple resistor divider using a 1K and 2K resistor can solve this problem as per the provided diagram. Note, also, that the Tx pin of the throttle must connect to the Rx pin of the 

In this example, the ESP32's pin 32 is used as the serial Tx pin, which connects directly to the Mega2560's Rx2 pin. This doesn't need a voltage divider, as the ESP32's 3.3V output is sufficient to communicate with the Mega2560's 5V input.

In this example, the ESP32’s pin 32 is used as the serial Tx pin, which connects directly to the Mega2560’s Rx2 pin. This doesn’t need a voltage divider, as the ESP32’s 3.3V output is sufficient to communicate with the Mega2560’s 5V input.

The ESP32's pin 33 is used as the serial Rx pin, which requires the resistor divider to protect it from the Mega2560's 5V output. The 1K resistor connects to the Mega's Tx2 pin with the 2K resistor to ground, and the ESP32's pin 33 connecting to where the two resistors join.

The ESP32’s pin 33 is used as the serial Rx pin, which requires the resistor divider to protect it from the Mega2560’s 5V output. The 1K resistor connects to the Mega’s Tx2 pin with the 2K resistor to ground, and the ESP32’s pin 33 connecting to where the two resistors join.

.. image:: /_static/images/throttles/mega-esp32-serial-connection.png
   :alt: Mega2560 serial to ESP32

The EX‑CommandStation/Booster One Express addresses the needs of DCC-EX users who want a ready-to-run DCC CommandStation. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

EX-CSB1 EX-CommandStation EX-CS Booster One Express Command Station

The |EX-CSB1-SHORT| is the first fully integrated DCC Command Station with |DC PWM| and |Booster Mode| capabilities developed by the DCC-EX Team.

This versatile board can function as a complete Command Station with USB or WiFi connectivity or serve as a stand-alone booster, making it an ideal addition to any layout, including those using non-DCC-EX systems.

If you are setting up your |EX-CSB1-SHORT| for the first time we recommend that you look at the :doc:`/ex-commandstation/rtr-connecting` page first.

.. figure:: /_static/images/ex-csb1/csb1_render_layout_top.png
   :alt: DCC-EX EX-CSB1 Express

   EX-CSB1 top (click image to enlarge it)

.. figure:: /_static/images/ex-csb1/barrel_jack1.png
   :alt: Barrel Jack
   :align: right

   Barrel Jack

The |EX-CSB1-SHORT| normally comes with a barrel jack for compatibility with most laptop-type power supplies that use a 2.1mm inner hole diameter and a 5.5mm outer shank diameter.

 normally comes with a barrel jack for compatibility with most laptop-type power supplies that use a 2.1mm inner hole diameter and a 5.5mm outer shank diameter.

Be careful since some power supplies have a 2.5mm inner hole which is likely to be too loose. The barrel jack input power is reverse voltage protected. This supplies a 5V switching regulator for all electronics on the board including a 3.3V regulator for 3.3V components, an optional |EX-MS| stacked on top, and power out to the track.

Be careful since some power supplies have a 2.5mm inner hole which is likely to be too loose. The barrel jack input power is reverse voltage protected. This supplies a 5V switching regulator for all electronics on the board including a 3.3V regulator for 3.3V components, an optional 

While it is capable of 10v-25v operation, it is best to choose a suitable track voltage for your scale. Typically this is 12-15v for N scale, and 14-16v for HO scale. With help in choosing your power supply or using one with bare wires instead of a barrel connector, see `Powering the EX-CSB1`_ below.

While it is capable of 10v-25v operation, it is best to choose a suitable track voltage for your scale. Typically this is 12-15v for N scale, and 14-16v for HO scale. With help in choosing your power supply or using one with bare wires instead of a barrel connector, see 

.. figure:: /_static/images/ex-csb1/usb_conn1.png
   :alt: USB Connector

   USB Connector

The USB connector can provide power from a computer or any 500mA or larger USB or USB-C Power Delivery (USB-C PD) power supply.  In this way you can connect your |EX-CSB1-SHORT| to a computer and update your software version or load |EX-R| scripts that run your accessories. However, without a power supply powering the DC input jack, you cannot supply power to the rails to run trains.

The USB connector can provide power from a computer or any 500mA or larger USB or USB-C Power Delivery (USB-C PD) power supply.  In this way you can connect your 

 scripts that run your accessories. However, without a power supply powering the DC input jack, you cannot supply power to the rails to run trains.

You can connect your track Power supply (see above) to the barrel jack while the USB is connected, as they will not interfere with each other. You may also wish to do this to isolate the |EX-CSB1-SHORT| processor power from any interruptions to track power due to overload for example.

You can connect your track Power supply (see above) to the barrel jack while the USB is connected, as they will not interfere with each other. You may also wish to do this to isolate the 

 processor power from any interruptions to track power due to overload for example.

The USB port is also very useful for connecting a |serial monitor| to test the command station and view logging information in real time to aid in fault finding. See :doc:`/reference/tools/serial-monitor`

 to test the command station and view logging information in real time to aid in fault finding. See 

.. figure:: /_static/images/ex-csb1/pluggable_connectors.png
   :alt: Pluggable Track Output Connectors

   Pluggable Track |BR| Output Connectors

These are female pluggable terminals that accept a removable male screw terminal plug (included with your |EX-CSB1-SHORT|). Using the removable connectors allows for easy reconfiguration, testing, and placement of your command station. You can unsolder these connectors (or ask for a special order) and replace them with 3.5mm pitch screw terminals if you prefer.

These are female pluggable terminals that accept a removable male screw terminal plug (included with your 

). Using the removable connectors allows for easy reconfiguration, testing, and placement of your command station. You can unsolder these connectors (or ask for a special order) and replace them with 3.5mm pitch screw terminals if you prefer.

For DCC operation, output A is usually the MAIN track and output B is the programming track. However, with our TrackManager :sup:`tm` feature, you can configure any output to be DCC, DC, MAIN, or PROG.

For DCC operation, output A is usually the MAIN track and output B is the programming track. However, with our TrackManager 

 feature, you can configure any output to be DCC, DC, MAIN, or PROG.

You should keep the phase of the tracks aligned, so if a train crosses from one power district to another it doesn't intentionally cause a short (unless it's a reversing loop and you have assigned that output to have Auto-Reverse capability.) See: :doc:`/ex-installer/managing-config-files`.

You should keep the phase of the tracks aligned, so if a train crosses from one power district to another it doesn’t intentionally cause a short (unless it’s a reversing loop and you have assigned that output to have Auto-Reverse capability.) See: 

Power to each output can be controlled together or individually. Correct wired gauge for the screw terminals is 16 to 28AWG (1.5mm^2). Be sure your wire gauge can handle the current you expect on the track.

.. figure:: /_static/images/ex-csb1/track_output_leds.png
   :alt: Track Output LEDs
   :scale: 70%

   Track Output LEDs

These are indicators that power is being sent to the track, and the mode of the output. With DCC operation, both LEDs should shine brightly when your throttle issues the power-on command.

You can also configure the |EX-CSB1-SHORT| to start with power on using a mySetup.h or myAutomation.h file, or by selecting one of the options in |EX-I|. See the :ref:`EX -Installer page <ex-installer/installing:start with power on>` for more information on how to change this behaviour.

 to start with power on using a mySetup.h or myAutomation.h file, or by selecting one of the options in 

:ref:`EX -Installer page <ex-installer/installing:start with power on>`

For |DC PWM| mode operation, when power is on, ONE LED will light for each direction. That is, forward will light one LED and when you select reverse, the other LED will light.

 mode operation, when power is on, ONE LED will light for each direction. That is, forward will light one LED and when you select reverse, the other LED will light.

.. figure:: /_static/images/ex-csb1/qwiic_conn.png
   :alt: Qwiic Connector
   :scale: 30%

   Qwiic Connector

This is a standard for an I2C bus connection so that the same cable can be used to daisy chain I2C devices like displays, sensors, servos, etc.

Please note the pin connection order when making your own cables or when purchasing from discount sites that often wire them incorrectly. For example, red should always be positive power and black is negative DC or "GND".

Please note the pin connection order when making your own cables or when purchasing from discount sites that often wire them incorrectly. For example, red should always be positive power and black is negative DC or “GND”.

:dcc-ex-red-bold-italic:`IMPORTANT: The voltage for this connector is ALWAYS 3.3V!``

.. figure:: /_static/images/ex-csb1/booster_conn.png
   :alt: Railsync Connector
   :scale: 35%

   Railsync Connector

This is a standard Railsync input and is labelled "Booster In" on the top of the board. Connecting a RailSync output from a Command Station or Booster will automatically switch the EXCSB1 to |Booster Mode| on receipt of an input signal when the |EX-CSB1-SHORT| is running the appropriate |EX-R| script.

This is a standard Railsync input and is labelled “Booster In” on the top of the board. Connecting a RailSync output from a Command Station or Booster will automatically switch the EXCSB1 to 

Again be sure to wire the DCC outputs to power districts with consistent phasing. Any voltage between 5V and 26V at the input will work. The Digitrax specification is from 12V to 26V. See `the DCCWiki article on RailSync <https://dccwiki.com/LocoNet_and_RailSync_Voltages>`_ |EXTERNAL-LINK|

Again be sure to wire the DCC outputs to power districts with consistent phasing. Any voltage between 5V and 26V at the input will work. The Digitrax specification is from 12V to 26V. See 

`the DCCWiki article on RailSync <https://dccwiki.com/LocoNet_and_RailSync_Voltages>`_

.. figure:: /_static/images/ex-csb1/oled_header.png
   :alt: OLED header

   OLED header

This header is primarily designed for an OLED display, but can also be used as a female header for any I2C device that has male pins or for use with Dupont jumper wires.

*IMPORTANT:* Many .96" and 1.3" OLED displays, and some others will connect directly to the pins, however **beware** that sadly there is no standard for pin order.

 Many .96” and 1.3” OLED displays, and some others will connect directly to the pins, however 

Make absolutely sure that any display you purchase to connect directly to the header has its pins in the correct order! The correct order is GND, V+, SCL, SDA and is different than other OLED connectors on the board. For more information see: :doc:`/reference/hardware/i2c-devices`.

Make absolutely sure that any display you purchase to connect directly to the header has its pins in the correct order! The correct order is GND, V+, SCL, SDA and is different than other OLED connectors on the board. For more information see: 

.. figure:: /_static/images/ex-csb1/dual_i2c_pins.png
   :alt: Dual Male I2C Header

   Dual Male I2C Header

This is a dual male pin I2C header with 2 rows of I2C bus connectors one beside the other. They are wired together on the same I2C bus as the QWiic connector and OLED I2C Header.

*IMPORTANT:* The pin order on these two rows are different from the OLED header, pay attention to the pin order when using Dupont female wires. The correct order for this header is SCL, GND, SDA and V+ as labelled on the board.

 The pin order on these two rows are different from the OLED header, pay attention to the pin order when using Dupont female wires. The correct order for this header is SCL, GND, SDA and V+ as labelled on the board.

The |EX-CSB1-SHORT| is a 3.3V device, so all the I2C connectors only supply 3.3V unlike the Arduino Mega. Keep that in mind if you are upgrading from a DIY Arduino Command Station to a 3.3V device like the EX-CSB1 and are connecting I2C devices. For more information see: :doc:`/reference/hardware/i2c-devices`.

 is a 3.3V device, so all the I2C connectors only supply 3.3V unlike the Arduino Mega. Keep that in mind if you are upgrading from a DIY Arduino Command Station to a 3.3V device like the EX-CSB1 and are connecting I2C devices. For more information see: 

.. figure:: /_static/images/ex-csb1/reset_button.png
   :alt: Reset Button
   :scale: 60%

   Reset Button

Pressing the reset button does a hard reset of the command station. If the Command Station gets into an unexpected state, you can reset it by pressing this button.

The DCC-EX software, |EX-R| Scripts, and any other settings are maintained, but the unit reboots as if it had been turned off. Boards stacked on top of the |EX-CSB1-SHORT| also receive the reset signal, but less well designed boards may not be reset depending upon their own circuit peculiarities. Only rarely should it require unplugging all power from the |EX-CSB1-SHORT| to perform a power-on hard reset.

 Scripts, and any other settings are maintained, but the unit reboots as if it had been turned off. Boards stacked on top of the 

 also receive the reset signal, but less well designed boards may not be reset depending upon their own circuit peculiarities. Only rarely should it require unplugging all power from the 

.. figure:: /_static/images/ex-csb1/esp32_1.png
   :alt: ESP32 Microcontroller

   ESP32 Microcontroller

One microcontroller controls everything on the |EX-CSB1-SHORT|. It runs the |EX-CS| software, any mySetup.h file instructions, any myAutomation.h scripts, and provides the WiFi connection to throttles.

 software, any mySetup.h file instructions, any myAutomation.h scripts, and provides the WiFi connection to throttles.

Be careful in your setup to protect WiFi antenna from being damaged from contact with anything or should the unit be dropped. For best WiFi performance, keep items at least 2cm (.75") from the antenna and do not allow any metallic objects to be near, underneath, or surrounding the antenna.

Be careful in your setup to protect WiFi antenna from being damaged from contact with anything or should the unit be dropped. For best WiFi performance, keep items at least 2cm (.75”) from the antenna and do not allow any metallic objects to be near, underneath, or surrounding the antenna.

.. figure:: /_static/images/ex-csb1/wifi_led2.png
   :alt: WiFi LED

   WiFi LED

When WiFi is enabled, this LED will stay on. It is under software control in the EX-CommandStation software, so the LED can be repurposed to indicate a user defined function with an |EX-R| script or a ``<U>`` command function.

When WiFi is enabled, this LED will stay on. It is under software control in the EX-CommandStation software, so the LED can be repurposed to indicate a user defined function with an 

.. figure:: /_static/images/ex-csb1/3v_led.png
   :alt: 3.3V LED
   :scale: 28%

   3.3V LED

The 3.3V power LED will light whenever the 3.3V regulator is powered. This occurs when powered by USB, or from an external power supply connected to the barrel jack. This is simply an indicator that the circuitry on the board is powered.

.. figure:: /_static/images/ex-csb1/5v_led.png
   :alt: 5V LED

   5V LED

The 5V LED will light whenever power is supplied to the barrel jack. This LED indicates that power is being supplied to the 5V regulator which can power an EX-MotorShield 8874 stacked onto the GPIO Headers.

Power from the barrel jack will power the 5V regulator which in turn powers the 3.3V regulator. Therefore, when power is supplied via the barrel jack, both the 5V and 3.3V LEDs will be lit.

The 4 GPIO headers accept a DCC-EX |EX-MS|. The |EX-CSB1-SHORT| itself has 2 outputs for 2 track power districts.

Stacking the EX8874 on these headers provides 2 additional power districts for a total of 4. Any of the 4 outputs can be used for any combination of **DCC MAIN**, **DCC PROG**, or **DC PWM**. You must enable the extra board from the EX-Installer or your config.h file for a manual install. See the :ref:`ex-commandstation/rtr-manual:adding an ex-motorshield 8874` section of this document.

Stacking the EX8874 on these headers provides 2 additional power districts for a total of 4. Any of the 4 outputs can be used for any combination of 

. You must enable the extra board from the EX-Installer or your config.h file for a manual install. See the 

:ref:`ex-commandstation/rtr-manual:adding an ex-motorshield 8874`

.. figure:: /_static/images/ex-csb1/oled_display.png
   :alt: OLED Display

   OLED Display

The OLED display provides diagnostics, status, and general information. The OLED display can also show output from |EX-R| scripts including user defined text. By default, the display shows the version number, license, power status, free memory, and if configured, your WiFi access point login information.

The OLED display provides diagnostics, status, and general information. The OLED display can also show output from 

 scripts including user defined text. By default, the display shows the version number, license, power status, free memory, and if configured, your WiFi access point login information.

.. figure:: /_static/images/ex-csb1/hot_area.png
   :alt: Hot Area Warning
   :scale: 36%

   Hot Area Warning

The entire area shown in the image to the right can get extremely hot during operation. Be carful not to touch this area at the top or bottom of the board to avoid being burned. This is especially true at high track current levels. Also be sure to provide proper ventilation to the board. If placed in a case, that case must have proper ventilation. Consider using proper vent holes and a fan if you intend to place the |EX-CSB1-SHORT| inside an enclosure.

The entire area shown in the image to the right can get extremely hot during operation. Be carful not to touch this area at the top or bottom of the board to avoid being burned. This is especially true at high track current levels. Also be sure to provide proper ventilation to the board. If placed in a case, that case must have proper ventilation. Consider using proper vent holes and a fan if you intend to place the 

.. figure:: /_static/images/ex-csb1/i2c_jumper_pads.png
   :alt: I2C Jumper Pads

   I2C Jumper Pads

.. figure:: /_static/images/ex-csb1/unpopulated_power_pins.png
   :alt: Unpopulated Power Pads

   Unpopulated |BR| Power Pads

These unpopulated solder pads are used internally for testing and can provide power connections for an optional header. When operated without an |EX-MS| on top, a user could remove the barrel jack and solder pins here capable of handling the 5A maximum current to power the board and the track.

These unpopulated solder pads are used internally for testing and can provide power connections for an optional header. When operated without an 

 on top, a user could remove the barrel jack and solder pins here capable of handling the 5A maximum current to power the board and the track.

.. figure:: /_static/images/ex-csb1/pin_legend.png
   :alt: Pin Legend

   Pin Legend

On the bottom of the board there are several markings such as the DCC-EX logo, board revision, and the QR code that links to this page on our website.

Additionally, important pins are labelled should you need access to them from the top of the board headers. Input/Output (GPIO) pins are labelled "IO36", "IO39", etc. GND, 5V, and 3.3V are also labelled. Note that when an EX-MotorShield8874 is stacked on top for extra power districts, there are no free GPIO pins left to connect accessories directly the |EX-CSB1-SHORT|. You must use the I2C pins and connect port expanders and/or servo boards to connect your accessories.

Additionally, important pins are labelled should you need access to them from the top of the board headers. Input/Output (GPIO) pins are labelled “IO36”, “IO39”, etc. GND, 5V, and 3.3V are also labelled. Note that when an EX-MotorShield8874 is stacked on top for extra power districts, there are no free GPIO pins left to connect accessories directly the 

. You must use the I2C pins and connect port expanders and/or servo boards to connect your accessories.

.. figure:: /_static/images/ex-csb1/2_1mm_screw_terminal_adapter.png
   :alt: 2.1mm screw terminal adapter

   2.1mm Screw |BR| Terminal Adapter

The |EX-CSB1| has a 2.1mm x 5.5mm power jack. If you already have a power supply with bare wires, you can use an optional 2.1mm x 5.5mm screw terminal block adapter. For more information about power supplies, including how to use one power supply to supply all the different voltages on your layout, see :ref:`Power Supplies <reference/hardware/power-supplies:power supplies>`.

 has a 2.1mm x 5.5mm power jack. If you already have a power supply with bare wires, you can use an optional 2.1mm x 5.5mm screw terminal block adapter. For more information about power supplies, including how to use one power supply to supply all the different voltages on your layout, see 

:ref:`Power Supplies <reference/hardware/power-supplies:power supplies>`

To power up the |EX-CSB1-SHORT|, just plug your power supply into the mains power (aka wall outlet) and connect the barrel end to the Command Station. Make sure your power supply matches the needs of your setup: the voltage should be between 12V and 25V DC, depending on the scale of your locomotives, and it should provide at least 2A of current with good over-current performance and voltage stability.

, just plug your power supply into the mains power (aka wall outlet) and connect the barrel end to the Command Station. Make sure your power supply matches the needs of your setup: the voltage should be between 12V and 25V DC, depending on the scale of your locomotives, and it should provide at least 2A of current with good over-current performance and voltage stability.

.. figure:: /_static/images/power/12v-3A-brick.png
   :alt: 12V brick power supply
   :scale: 100%

   12V Power Supply

To get the most out of your |EX-CSB1-SHORT|, we suggest using a modern switching power supply with 4A or more. For Z scale, 12V is usually enough, but for N, HO, and OO scales, we recommend using between 14V and 16V DC. It's important that your DC power is well-regulated which is why we suggest a modern switch-mode power supply with double insulation and strong overload protection.

, we suggest using a modern switching power supply with 4A or more. For Z scale, 12V is usually enough, but for N, HO, and OO scales, we recommend using between 14V and 16V DC. It’s important that your DC power is well-regulated which is why we suggest a modern switch-mode power supply with double insulation and strong overload protection.

Your power supply can be rated at *or above* the specified Amperage rating. You must not exceed the voltage rating of your device, but a little extra current is ok, since the |EX-CSB1-SHORT| will only use as much as it needs. However, remember that both voltage and current can be dangerous.

 the specified Amperage rating. You must not exceed the voltage rating of your device, but a little extra current is ok, since the 

 will only use as much as it needs. However, remember that both voltage and current can be dangerous.

TODO XXX For more details on how much current do I need, see [link] XXX

When you connect power to the |EX-CSB1-SHORT|, you should see one or both bright green power LEDs light up, confirming that the electronics are working.

, you should see one or both bright green power LEDs light up, confirming that the electronics are working.

However, for safety, track power will be off by default when you first plug in the |EX-CSB1-SHORT|. This is to prevent power from accidentally being applied to your layout before everything is ready. See the :ref:`EX -Installer page <ex-installer/installing:start with power on>` for more information on how to change this behaviour.

However, for safety, track power will be off by default when you first plug in the 

. This is to prevent power from accidentally being applied to your layout before everything is ready. See the 

**A Power supply** (12V - 16V DC see :ref:`Power Supplies <reference/hardware/power-supplies:power supplies>`)

**A throttle** (You can use your phone or a computer - see below)

A **USB cable** with one end a USB-C for the EX-CSB1, and the other to suit your PC*

 with one end a USB-C for the EX-CSB1, and the other to suit your PC*

Optional for connecting connecting to a computer for |EX-WT|, |JMRI| and to reload the |EX-CS| software.

Before connecting any wires to your command station or tracks, make sure you have unplugged the power supply from the wall or removed the barrel connector from the command station. It is crucial to ensure that the command station has no power while you are working on your connections.

The power connection to your track will be either wires you solder yourself to the rails or via a power connector that plugs into track such as Kato Unitrack. We will leave it up to you to determine the proper connection to your track.

Once you are sure power is disconnected from the CS and the power LED is no longer illuminated, you can connect wires from the A output (+ and -) of the command station to the track.

For |DCC| operation it does not matter which wire goes to which rail, since there is no polarity. However, as you layout grows, it is important to stay consistent with your wiring to ensure that different power districts remain in phase. That just means that when the tracks rapidly switch between one being energized and the other at ground potential, all the districts stay synchronised.

 operation it does not matter which wire goes to which rail, since there is no polarity. However, as you layout grows, it is important to stay consistent with your wiring to ensure that different power districts remain in phase. That just means that when the tracks rapidly switch between one being energized and the other at ground potential, all the districts stay synchronised.

todo XXX You can find more detail on this in our wiring section XXX. [link]

For |DC| operation, polarity does matter. One rail is positive, and the other is negative, which determines the direction your train will move when voltage is applied through the command station. If you reverse the voltage, the train will change direction and run in reverse.

 operation, polarity does matter. One rail is positive, and the other is negative, which determines the direction your train will move when voltage is applied through the command station. If you reverse the voltage, the train will change direction and run in reverse.

Refer to :ref:`ex-commandstation/rtr-manual:dc operation` section for information.

You will notice that the two track outputs on the |EX-CSB1-SHORT| are labelled A and B. In the standard DCC-EX configuration of a EX-CSB1, A is configured for DCC MAIN operation, and B is configured for PROG or programming track output. We recommend connecting your track to the A MAIN output initially to test your Command Station. To alter this default configuration of |DCC| outputs, or for |DC| Mode, you would need to configure outputs with a TrackManager command in the mySetup.h file or via Routes. See :doc:`the TrackManager page </trackmanager/index>`

 are labelled A and B. In the standard DCC-EX configuration of a EX-CSB1, A is configured for DCC MAIN operation, and B is configured for PROG or programming track output. We recommend connecting your track to the A MAIN output initially to test your Command Station. To alter this default configuration of 

 Mode, you would need to configure outputs with a TrackManager command in the mySetup.h file or via Routes. See 

The pluggable male screw terminals accept to 16 to 28 AWG/1.5mm^2 gauge solid or stranded wire. If you use stranded, we recommend "tinning" the ends of the wire to make a good connection and ensure that stray wire whiskers don't stray outside the screw terminals and cause a short circuit. Larger wire can handle more current and provide less resistance.  18-22 AWG is a good start. Keep your wires short by mounting the CS close to the track. See the :doc:`/reference/hardware/wire-gauge` page for more information on wire gauge.

The pluggable male screw terminals accept to 16 to 28 AWG/1.5mm^2 gauge solid or stranded wire. If you use stranded, we recommend “tinning” the ends of the wire to make a good connection and ensure that stray wire whiskers don’t stray outside the screw terminals and cause a short circuit. Larger wire can handle more current and provide less resistance.  18-22 AWG is a good start. Keep your wires short by mounting the CS close to the track. See the 

Unscrew both screw terminals with a flat blade jeweller's screwdriver. The screws just need to be loosened enough to fit your wires into the holes. Tighten down both screws once you have inserted the wires.

Unscrew both screw terminals with a flat blade jeweller’s screwdriver. The screws just need to be loosened enough to fit your wires into the holes. Tighten down both screws once you have inserted the wires.

Now you can connect your track power supply to the barrel connector on the |EX-CSB1-SHORT| and then plug the other end into the wall. You should see status information on the display including the |EX-CSB1-SHORT| firmware version.

Now you can connect your track power supply to the barrel connector on the 

 and then plug the other end into the wall. You should see status information on the display including the 

If you do not have a display or your display is not working, you will need to connect a :doc:`serial monitor </reference/tools/serial-monitor>`.

If you do not have a display or your display is not working, you will need to connect a 

TODO XXX This is a mess of having to have so many options and send people back and forth and have an entire section on using a serial monitor. Just link to it? Yeah... link to it... it's why I insisted on an OLED display XXX PMA :-P )

The |EX-CSB1| will power up in WiFi Access Point mode as configured out of the box, with a Wifi network SSID of ``DCCEX_xxxxxx`` and password of ``PASS_xxxxxx``, both of which will be visible on the OLED display (or |serial monitor| log) after it boots.

 will power up in WiFi Access Point mode as configured out of the box, with a Wifi network SSID of 

.. figure:: /_static/images/ex-csb1/oled_startup.png
   :alt: EX-CSB1 Startup - OLED screen

   EX-CSB1 Startup - OLED screen

* **Access Point (AP) mode** creates a separate WiFi network on the Command Station itself. (Most useful if your layout is away from the house / home network, or you transport your layout frequently.)

* **Station (STA) mode** allows the Command Station to join as a WiFi device on your home or layout WiFi network. We have the EX-CSB1 set to default to AP mode for convenience of being able to get up and running quickly.

**Access Point (AP) mode** creates a separate WiFi network on the Command Station itself. (Most useful if your layout is away from the house / home network, or you transport your layout frequently.)

 creates a separate WiFi network on the Command Station itself. (Most useful if your layout is away from the house / home network, or you transport your layout frequently.)

**Station (STA) mode** allows the Command Station to join as a WiFi device on your home or layout WiFi network. We have the EX-CSB1 set to default to AP mode for convenience of being able to get up and running quickly.

 allows the Command Station to join as a WiFi device on your home or layout WiFi network. We have the EX-CSB1 set to default to AP mode for convenience of being able to get up and running quickly.

The WiFi LED will illuminate once WiFi is configured and ready as an Access Point (or Station if reconfigured for STA mode.)

You can connect to the |EX-CSB1| using both an app via Wifi on a smartphone or tablet, and/or on a PC using |EX-WT| with the PC plugged into the EX-CSB1's USB-C port. Detailed instructions are here https://dcc-ex.com/ex-commandstation/controllers.html#choosing-a-throttle-controller

 using both an app via Wifi on a smartphone or tablet, and/or on a PC using 

 with the PC plugged into the EX-CSB1’s USB-C port. Detailed instructions are here 

TODO XXX should title be "connecting with your phone?" Do we link to the engine driver page or give a short version here? Or to we break up the page and the 'Next' button goes to a mirrored page so there is only one page to maintain?

Please connect your smartphone or tablet where you previously installed |Engine Driver| or |WiThrottle| to this WiFi network with the password shown on the OLED to begin running trains immediately!

Please connect your smartphone or tablet where you previously installed 

 to this WiFi network with the password shown on the OLED to begin running trains immediately!

You have nothing further to do to start using your DCC-EX |EX-CSB1|. You can remove the protective cover on the OLED if you wish.

TODO XXX figure image of phone logging in to the AP

.. NOTE:: Note that some smart phones and tablets will try hard to only connect you to a WiFi network that has Internet access, and you may be asked if you really want to connect to a WiFi network without it. For the sake of getting up and running quickly, just dismiss such queries. In the next section we show you how to reconfigure the EX-CSB1 to join your home or layout WiFi network should you prefer it.

You can connect to the |EX-CSB1| using both an app via Wifi on a smartphone or tablet, and on a PC by using |EX-WT| with the PC plugged into the EX-CSB1's USB-C port.

 using both an app via Wifi on a smartphone or tablet, and on a PC by using 

Connect the USB-C end of the USB cable to the |EX-CS|. Connect the other end to your computer or laptop on which you will run |EX-WT|.

. Connect the other end to your computer or laptop on which you will run 

.. figure:: /_static/images/ex-csb1/csb1_power_usb.png
   :alt: Connecting USB cable

   Connecting USB cable

Note that 5V power is supplied with the USB connection, so the single green 3.3V LED illuminates (See figure). This powers the electronics on the board for basic testing and to apply software updates, but will not power the track outputs until power is applied through the barrel jack.

You do NOT need USB power for normal operation. The blue WiFi LED will also illuminate indicating the |EX-CSB1-SHORT| is setup for a WiFi connection. And last, the display will show status information.

You do NOT need USB power for normal operation. The blue WiFi LED will also illuminate indicating the 

 is setup for a WiFi connection. And last, the display will show status information.

Begin by running |EX-WT| by `clicking this link <https://dcc-ex.github.io/WebThrottle-EX>`_. Detailed instructions are available on the :doc:`/ex-webthrottle/index` page.

The EX-CSB1 is set to operate in |DCC| mode by default. You can switch to any of the outputs to |DC PWM| mode.

The process to change the outputs to |DC| are described in detail in the :doc:`/trackmanager/index` page.

Additional technical information about |DC PWM| are explained on our :doc:`/reference/hardware/dcc-vs-dc`.

When using |DC PWM| mode with the |EX-CSB1|, it is important to understand that this mode does not produce the traditional varying of the DC voltage to control the speed of your loco through a legacy Transformer.   The speed of your train is controlled using a method called |DC PWM| (Pulse Width Modulation), so instead, the track always receives full voltage whenever the throttle is set above zero, just in pulses rather than continuously.

, it is important to understand that this mode does not produce the traditional varying of the DC voltage to control the speed of your loco through a legacy Transformer.   The speed of your train is controlled using a method called 

 (Pulse Width Modulation), so instead, the track always receives full voltage whenever the throttle is set above zero, just in pulses rather than continuously.

The |EX-CS| uses a loco (cab) address to control and drive a district/track with a number from 1 to 10239.  So, you are controlling and driving a track with PWM and any analogue DC loco sitting on that DC district track, rather than controlling the loco itself.

 uses a loco (cab) address to control and drive a district/track with a number from 1 to 10239.  So, you are controlling and driving a track with PWM and any analogue DC loco sitting on that DC district track, rather than controlling the loco itself.

As opposed to DCC which controls many locos on a DCC district directly through the individual DCC Address assigned to the decoder inside the loco.

The visual effect to a Engineer is that he can have one throttle controlling both DC and DCC locos from the actual road number that appears on the side of the loco.
DC loco# 667 running on a separate DC district/track assigned 667, versus a DCC loco# 1225 running on a separate DCC Main line track with many other locos.

If you want to switch to any of the outputs to |DC PWM| mode, you can find instructions on how to do that on the :doc:`/trackmanager/index` page.

TODO XXX - any reason you didn't you just copy my very carefully written Getting Started Guide content here??? PMA

We have found that there are a small number of users who can have an issue when trying to update firmware or upload EXRAIL scripts to an EX-CSB1 Command Station (or any ESP32 based device).

If you are having problems, look at our `uploading troubleshooting guide <https://dcc-ex.com/news/posts/20250128.html>`_.

`uploading troubleshooting guide <https://dcc-ex.com/news/posts/20250128.html>`_

The |EX-CSB1| comes preloaded with the Command Station software, so you can start using it right out of the box.

 comes preloaded with the Command Station software, so you can start using it right out of the box.

However, if you wish to customise its configuration or update the software, you can easily do so by connecting the |EX-CSB1| to your computer via USB and follow the steps below to make any changes you need.

However, if you wish to customise its configuration or update the software, you can easily do so by connecting the 

 to your computer via USB and follow the steps below to make any changes you need.

Locate the USB Port: Find the USB-C port on your |EX-CSB1-SHORT|.
Use a Compatible USB Cable: Grab a USB-C cable that matches the port on your PC or laptop. This will likely be a USB-A to USB-C cable for older PCs and laptops, or a USB-C to USB-C for more modern PCs and laptops.
Plug It In: Connect one end of the USB cable to the |EX-CSB1-SHORT| and the other end to an available USB port on your computer.

.
Plug It In: Connect one end of the USB cable to the 

In most cases, your computer will automatically recognise the |EX-CSB1-SHORT| then you connect it and install the necessary USB serial drivers.

 then you connect it and install the necessary USB serial drivers.

If you don't see a port listed there and are using a clone board, you may have to install a driver for a CH340 USB chip that is on these boards. See `Drivers for the CH340 <https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all>`_ for detailed instructions.

If you don’t see a port listed there and are using a clone board, you may have to install a driver for a CH340 USB chip that is on these boards. See 

`Drivers for the CH340 <https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all>`_

Download and run the |EX-I| program on your computer following the instructions on the :doc:`/ex-commandstation/installer-rtr` page.

Open the Command Station Software: Once the software is updated or if you're making adjustments, launch it from your desktop or start menu.

Check the Connection: The software should automatically detect the |EX-CSB1|. If it doesn't, ensure that your USB cable is securely connected and try again.

With the |EX-CSB1| connected, you're ready to start using it or making any necessary adjustments to the configuration. Explore the features and tailor the settings to optimise your model railway experience.

On subsequent connections of your |EX-CSB1| to you PC loading the drivers will be automatic.

You only need to run the |EX-I| program on your computer following the instructions on the :doc:`/ex-commandstation/installer-rtr` page.

As the |EX-I| program is updated periodically, it is worth checking from time-to-time to see if there is a new version by checking the :doc:`/ex-installer/index` page.

 program is updated periodically, it is worth checking from time-to-time to see if there is a new version by checking the 

|EX-R| is an "|EX-R-FULL|" that can easily be used to describe sequential command 'sequences' to automatically take place on your model layout. These sequences are defined programmatically in a simple command script file, and uploaded to the Command Station once to configure it. |EX-R| will then run automatically on |EX-CS| startup, trigger manually, or on occurrence of the specified events.

” that can easily be used to describe sequential command ‘sequences’ to automatically take place on your model layout. These sequences are defined programmatically in a simple command script file, and uploaded to the Command Station once to configure it. 

 startup, trigger manually, or on occurrence of the specified events.

To find out more about |EX-R| and how to add them to your |EX-CSB1| see the :doc:`/exrail/index` page.

If you need to reset your |EX-CSB1-SHORT| Command Station software to its default settings, you'll need to reinstall the software using the default settings. Follow these steps to reset the software:

 Command Station software to its default settings, you’ll need to reinstall the software using the default settings. Follow these steps to reset the software:

Before you begin, make sure the Command Station is powered off. Unplug the power supply from the wall or disconnect the barrel connector from the |EX-CSB1-SHORT|. This ensures that the system is completely powered down before the reset process.

Before you begin, make sure the Command Station is powered off. Unplug the power supply from the wall or disconnect the barrel connector from the 

. This ensures that the system is completely powered down before the reset process.

Connect the |EX-CSB1-SHORT| to your computer using the appropriate USB cable.

Plug the power supply back in or reconnect the barrel connector to power on the |EX-CSB1-SHORT|.

Plug the power supply back in or reconnect the barrel connector to power on the 

Go to the :doc:`official DCC-EX website </ex-installer/installing>`.

Save the |EX-I| file to a location on your computer where you can easily access it.

 file to a location on your computer where you can easily access it.

Locate the downloaded installer file on your computer and double-click to run it.

Following the instructions on the :doc:`/ex-commandstation/installer-rtr` page.

|EX-I| will guide you through the reinstallation process. During this process, the existing software on the |EX-CSB1| will be overwritten with the default settings.

 will guide you through the reinstallation process. During this process, the existing software on the 

Allow |EX-I| to complete the process. Once done, the Command Station will be reset to its original configuration.

 to complete the process. Once done, the Command Station will be reset to its original configuration.

After the installation is complete, power up the |EX-CSB1-SHORT| to ensure it's running correctly with the default settings.

Confirm that the software has been reset by checking the basic settings and making sure they match the defaults.

If you need to adjust the settings to suit your layout, you can now do so within |EX-I|.

If you need to adjust the settings to suit your layout, you can now do so within 

Power up your layout and test the system to ensure everything is working as expected.

There are a number ways to open a |serial monitor| to the |EX-CSB1|.  They are discussed on the :doc:`/reference/tools/serial-monitor` page, and any are acceptable.

To discuss just one of those options, which will likely be the easiest to do if you have recently installed the Command Station software using |EX-I|. Simply click the :guilabel:`Serial Monitor` button when the the |EX-CSB1-SHORT| is connected via USB to your PC.

To discuss just one of those options, which will likely be the easiest to do if you have recently installed the Command Station software using 

The |EX-CSB1-SHORT| allows you to expand your model railway setup by connecting various |I2C| accessories such as sensors, displays, and GPIO expanders. Using the DCC-EX |EX-I| and additional tools, you can easily configure these accessories to work with your layout.

 allows you to expand your model railway setup by connecting various 

 accessories such as sensors, displays, and GPIO expanders. Using the DCC-EX 

 and additional tools, you can easily configure these accessories to work with your layout.

Choose Compatible Accessories:
Common |I2C| accessories include displays (e.g., OLED, LCD), sensors (e.g., temperature, distance), and GPIO expanders.
Ensure your accessories are compatible with |I2C| and check the DCC-EX website for supported devices.

 accessories include displays (e.g., OLED, LCD), sensors (e.g., temperature, distance), and GPIO expanders.
Ensure your accessories are compatible with 

Locate the |I2C| Ports:
Use the "|I2C| x 2" ports for general |I2C| devices.
Use the "OLED |I2C|" port if you're connecting an OLED display.
Wiring the Devices:
SDA (Data Line): Connect the SDA pin on your accessory to the SDA pin on the |EX-CSB1-SHORT|.
SCL (Clock Line): Connect the SCL pin on your accessory to the SCL pin on the |EX-CSB1-SHORT|.
Power: Depending on your device's requirements, connect the VCC pin to either 3.3V or 5V on the |EX-CSB1-SHORT|. Connect the GND pin to GND.
Daisy-Chaining Multiple Devices: If connecting more than one |I2C| device, ensure each has a unique |I2C| address, which can be set via jumpers or configuration switches.

” port if you’re connecting an OLED display.
SDA (Data Line): Connect the SDA pin on your accessory to the SDA pin on the 

.
SCL (Clock Line): Connect the SCL pin on your accessory to the SCL pin on the 

.
Power: Depending on your device’s requirements, connect the VCC pin to either 3.3V or 5V on the 

. Connect the GND pin to GND.
Daisy-Chaining Multiple Devices: If connecting more than one 

 address, which can be set via jumpers or configuration switches.

Visit the |EX-I| page to download the latest version.
Follow the on-screen instructions to install the software on your computer.
Run the Installer:

 page to download the latest version.

Connect your |EX-CSB1-SHORT| to your computer via USB.
Open the |EX-I|. The installer will guide you through the initial setup, including basic configurations like setting up |I2C| displays.
Configuring |I2C| Displays:

. The installer will guide you through the initial setup, including basic configurations like setting up 

The installer will allow you to configure connected displays (such as OLED or LCD) directly during the setup process.
For other |I2C| devices, further configuration may require manual adjustments using the |EX-CS| software or editing configuration files.

For other 

 devices, further configuration may require manual adjustments using the 

For advanced |I2C| accessories like sensors or GPIO expanders, you may need to manually configure them via the |EX-CS| software.
This involves accessing configuration files or using a |serial monitor| to input specific commands.

 accessories like sensors or GPIO expanders, you may need to manually configure them via the 

 software.
This involves accessing configuration files or using a 

If necessary, open the configuration files provided with the DCC-EX software to manually add and configure your |I2C| devices. Instructions for this can be found on the DCC-EX documentation pages.

If necessary, open the configuration files provided with the DCC-EX software to manually add and configure your 

 devices. Instructions for this can be found on the DCC-EX documentation pages.

After configuring your devices, ensure you save and apply your settings through the CommandStation software.
Step 5: Testing and Troubleshooting

Once configured, power on your layout and check if the |I2C| devices are functioning correctly.
Use the diagnostics tools provided by the DCC-EX software to troubleshoot any issues.

 devices are functioning correctly.

Double-check wiring connections and |I2C| addresses.
If issues persist, refer to the troubleshooting guides on the DCC-EX website.

 addresses.

For more detailed instructions and support, refer to these resources:

todo XXX are these main headings or subheadings of what is above?

You can and an |EX-MS| to provide an additional 2 outputs. You may want to do this if you want to split your DCC layout into separate power districts or if running |DC PWM|, create up to 4 blocks before you need to add a booster.

 to provide an additional 2 outputs. You may want to do this if you want to split your DCC layout into separate power districts or if running 

An EX-FastClock is a standalone adjustable speed clock built using an additional microcontroller to work with your EX-CommandStation. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

|SUITABLE| |tinkerer| |engineer| |support-button| |githublink-ex-fastclock-button-small|

Dupont type wires to connect the components, male to female or female to female as required

A USB cable to connect the Arduino to a PC to load the software

The software for the |EX-FC| can be found in the |EX-FC| repository in the |DCC-EX| GitHub.  The code can be configured to run a clock which will communicate to the |EX-CS| by either Serial or I2C.  The options are chosen from the file config.h.  Instructions are contained in the README.md file.  Which option you choose will depend upon weather you have serial throttles connected to the serial ports in which case I2C might be the better option.  Alternatively if you already have lots of I2C devices then it might be better to run the Serial option.

 GitHub.  The code can be configured to run a clock which will communicate to the 

 by either Serial or I2C.  The options are chosen from the file config.h.  Instructions are contained in the README.md file.  Which option you choose will depend upon weather you have serial throttles connected to the serial ports in which case I2C might be the better option.  Alternatively if you already have lots of I2C devices then it might be better to run the Serial option.

Now that you know what you need, click the 'Next' button see how you use |EX-FC|.

Now that you know what you need, click the ‘Next’ button see how you use 

First we need the 'objects' that we will use for our automation sequences.

First we need the ‘objects’ that we will use for our automation sequences.

There are a number key objects that are important for creating sequences:

`Servos for Semaphores/Signals and Animations <#servos-for-signals-and -animations>`_

Configuring |EX-CS| by modifying 'myAutomation.h' so that it knows about the object

 by modifying ‘myAutomation.h’ so that it knows about the object

COMMANDS are case sensitive. i.e. they must be in uppercase. Text parameters you provide (aliases,  descriptions) are not.

You must avoid using these characters in all descriptions: ``<``, ``>``, ``"`` as these are part of the |DCC-EX| protocol and are likely to prevent descriptions showing up in |JMRi| and other throttle software/clients.

|EX-R| has a ``ROSTER()`` function to allow you to define all of your locomotives with a list of their defined functions which is advertised to WiThrottle applications, just like turnouts/points and routes.

 function to allow you to define all of your locomotives with a list of their defined functions which is advertised to WiThrottle applications, just like turnouts/points and routes.

The functions can simply be listed as "F" numbers, or you can provide a text description of the function. Prefacing the function with a "*" indicates it is momentary, meaning it is only activated while holding that function button down.

The functions can simply be listed as “F” numbers, or you can provide a text description of the function. Prefacing the function with a “*” indicates it is momentary, meaning it is only activated while holding that function button down.

In a text editor (e.g. notepad) create a new text file named 'myAutomation.h'. (Note the capital 'A' in the name.  The case of all the characters is important.)

In a text editor (e.g. notepad) create a new text file named ‘myAutomation.h’. (Note the capital ‘A’ in the name.  The case of all the characters is important.)

If you are already using |EX-R| and have a myAutomation.h, then just the add ``ROSTER(...)`` lines near the top of the file.

**My Loco Name** - is anything you want to see as the name of this loco in the throttle apps

 - is anything you want to see as the name of this loco in the throttle apps

**F0 F1 F3 ... F27**. - are the names that you want to see for the functions specific to this loco

. - are the names that you want to see for the functions specific to this loco

**\*F2** - note that if the function is 'momentary' rather than 'latching' (On/Off) then start the function label with a asterisk (\*).  The most common example of this is the Horn/Whistle which is commonly on F2.

 - note that if the function is ‘momentary’ rather than ‘latching’ (On/Off) then start the function label with a asterisk (*).  The most common example of this is the Horn/Whistle which is commonly on F2.

ROSTER (  3,"Eng 3", "F0/F1/*F2/*F3/F4/F5/F6/F7/Mute/F9//") // Address 3, Eng 3, Function keys F0-F10
ROSTER(1224,"PE 1224","") // Motor Only Decoder, But use Engine Driver 'Preferences >In Phone Loco 'Sound'
ROSTER(1225,"PE 1225","Lights/Bell/*Whistle/*Short Whistle/Steam/On-Time/FX6 Bell Whistle/Dim Light/Mute")
ROSTER(4468,"LNER 4468","//Snd On/*Whistle/*Whistle2/Brake/F5 Drain/Coal Shvl/Guard-Squeal/Loaded/Coastng/Injector/Shunt-Door ~Opn-Cls/Couplng/BrakeVlv/Sfty Vlv/Shunting/BrkSql Off/No Momentm/Aux3/Fade Out/F22 Res/F23/Res//Aux 5/Aux6/Aux7/Aux 8")

A more complex example with generic functions for the same loco (note the momentary F2 for horn):

The same again, with more text functions defined to represent a number of different sounds:

If a function is not available just leave the spot empty. (Don't even have the space character.)

For example:

.. code-block:: cpp

   ROSTER(2825,"CN ES44AC","Headlight/Bell/*Horn/Coupler/Dynamic Brake///Flange Squeal/Startup & Shutdown")

Note the two missing text labels for positions F5 and F6. Engine Driver will skip those buttons and not display them at all in the interface since they do nothing for that loco.

Example of loco without sound:

   ROSTER(2405,"AT&SF 2-8-0 2405","Headlight")

Note that it only has FO (the Headlight) and not following slashes.

If a function is not available just leave the spot empty. (Don’t even have the space character.)

ROSTER(2825,"CN ES44AC","Headlight/Bell/*Horn/Coupler/Dynamic Brake///Flange Squeal/Startup & Shutdown")

If you add a roster entry for DCC address zero (0) it will become the default for all manually acquired locos.

   ROSTER(0,"Default","Lights/Bell/*Horn/F3/F4/F5/F6/F7/F8/F9/10/F11/F12/F13/F14/F15/F16/F17/F18/F19/F20/F21/F22/F23/F24/F25/F26/27/F28/F29/F30/F31")

Put an ``*`` ahead of any that you want momentary

This is especially useful for European and British prototype sound decoders which sometimes use F1 and/or F2 for other purposes.

For example, to make F2 default to latching you may want to add..

   ROSTER(0,"Default","Lights/Bell/F2/F3/F4/F5/F6/F7/F8/F9/10/F11/F12/F13/F14/F15/F16/F17/F18/F19/F20/F21/F22/F23/F24/F25/F26/27/F28/F29/F30/F31")

If you have installed turnouts/points using DCC accessory decoders, you can config the |EX-CS| so that it knows about it and you can control in in your sequences.

If you have installed turnouts/points using DCC accessory decoders, you can config the 

 so that it knows about it and you can control in in your sequences.

 TURNOUT( id, addr, sub_addr [, "description"] )

The ``TURNOUT`` command defines DCC accessory decoder turnout/point in |EX-R|, which will appear in |WiThrottle Protocol| apps, |Engine Driver|, and |JMRI| in addition to being defined as a turnout/point within the CommandStation.

 in addition to being defined as a turnout/point within the CommandStation.

You can also refer to :doc:`/ex-commandstation/accessories/turnouts/solenoid-turnouts` for more information.

If you have installed turnouts/points using simple pin control, you can config the |EX-R| so that it knows about it and you can control in in your sequences.

If you have installed turnouts/points using simple pin control, you can config the 

 PIN_TURNOUT( id, vpin [, "description"] )

The ``PIN_TURNOUT`` command defines a pin operated turnout/point in |EX-R|, which will appear in |WiThrottle Protocol| apps, |Engine Driver|, and |JMRI| in addition to being defined as a turnout/point within the CommandStation.

When setting up a turnout/point where multiple pins are required for control, the ``VIRTUAL_TURNOUT`` command should be used along with a control sequence. This is commonly used to configure solenoid-based turnout motors.

When setting up a turnout/point where multiple pins are required for control, the 

 command should be used along with a control sequence. This is commonly used to configure solenoid-based turnout motors.

DONE \
SET(p2) RESET(p3) \
SET(p1) DELAY(PULSE) RESET(p1) \
DONE
RESET(p2) SET(p3) \
DONE

You can also refer to :doc:`/reference/hardware/servo-module` for more information.

To connect a servo to |EX-CS|, you first need to get a module, based on the PCA9685 chip.

.. image:: /_static/images/i2c/pca9685.jpg
   :alt: PCA9685 Servo Module

These are widely available from eBay, Amazon, etc. for a few dollars.

Note the pin connectors along the left side of the module - these are where you connect to the Arduino.

The 16 columns of three pins along the bottom of the module are where you connect the servos. The pins are arranged so that you can just plug a servo connector directly onto them, but be sure that the wire colours match the colours of the pins, i.e. yellow to yellow, red to red and black to black.

The servo module itself is powered from the Arduino, but the servos themselves contain motors that consume more current than the Arduino is able to supply, and so a separate 5V supply is required for the servos.  This is connected to the green terminal block at the top of the module, with terminals labelled V+ and GND. The V+ terminal is connected to 5V and the GND to the 0V (ground) wire of the supply.

Connections to the Arduino are made with four jumper wires (Arduino: +5V, GND, SCL, SDA to servo module: **VCC**, GND, SCL, SDA), as shown on the following diagram:

Connections to the Arduino are made with four jumper wires (Arduino: +5V, GND, SCL, SDA to servo module: 

.. image:: /_static/images/i2c/ArduinoMegaServo.png

In |EX-CS|, the drivers for the PCA9685 module is already installed, and made available to for use as pin numbers 100-115. A servo is shown in the diagram, connected to the first set of pins on the module.  This will be accessed using pin number 100.

, the drivers for the PCA9685 module is already installed, and made available to for use as pin numbers 100-115. A servo is shown in the diagram, connected to the first set of pins on the module.  This will be accessed using pin number 100.

Once you've made all of the connections, apply power to the Arduino.

Once you’ve made all of the connections, apply power to the Arduino.

Then, in the |serial monitor|, enter the command `<D SERVO 100 450>`.  The servo should move, as long as it isn't (by some fluke) already in that position.

.  The servo should move, as long as it isn’t (by some fluke) already in that position.

Enter `<D SERVO 100 110>` and this time it should definitely move.  For the last parameter (servo position) you can use any value between about 105 and 490.

 and this time it should definitely move.  For the last parameter (servo position) you can use any value between about 105 and 490.

Try `<D SERVO 100 450 3>` and the servo should move slowly back.

You can use the servo to control turnouts/points, semaphore signals, engine shed doors, and other layout components, to make your layout more dynamic and exciting.  In the picture below, you can see a servo mounted below the baseboard with a piece of wire passing through a slot cut in the baseboard, to operate a turnout/point.

.. image:: /_static/images/i2c/TurnoutServoMount.jpg
   :alt: Servo mount to operate a turnout/point

And in the next picture you can see a servo that operates a semaphore signal.  The signal, and its servo mounting bracket, were 3d-printed on a Creality Ender-3 printer.

.. image:: /_static/images/i2c/SemaphoreSignal.jpg
   :alt: Servo mount to operate a Semaphore Signal

The myAutomation.h file needs to be altered so that the |EX-CS| knows about each Turnout/Point.

`Turnouts via the SERVO_TURNOUT directive <#controlling-servos-for-turnouts-points>`_

`Animations via the SERVO or SERVO2 directives <#servos-for-animations>`_

The ``SERVO_TURNOUT`` directive defines a servo based turnout/point in |EX-R|, which will appear in |WiThrottle Protocol| apps, |Engine Driver|, and |JMRI| in addition to being defined as a turnout/point within the CommandStation.

As per the |EX-R| reference, turnouts/points are defined with the following syntax:

 reference, turnouts/points are defined with the following syntax:

// Example
SERVO_TURNOUT(id, pin, active_angle, inactive_angle, profile [, "description"])

// Example
SERVO_TURNOUT(200, 101, 450, 110, Slow, "Example slow turnout/point definition")

/* An example definition for a servo connected to the second control pins of the first PCA9685 connected to the CommandStation, using the slow profile for prototypical operation: */The valid parameters are:

id = Unique ID within the CommandStation (note these are shared across turnouts/points, sensors, and outputs).

pin = The ID of the pin the servo is connected to, which would typically be the VPin ID of the PCA9685 controller board.

active_angle = The angle to which the servo will move when the turnout/point is thrown (refer below for further detailed information).

inactive_angle = The angle to which the servo will move when the turnout/point is closed (refer below for further detailed information).

profile = There are five profiles to choose from that determine the speed at which a turnout/point will move: Instant, Fast, Medium, Slow, and Bounce (note we don't recommend Bounce for a turnout/point definition).

profile = There are five profiles to choose from that determine the speed at which a turnout/point will move: Instant, Fast, Medium, Slow, and Bounce (note we don’t recommend Bounce for a turnout/point definition).

description = A human-friendly description of the turnout/point that will appear in WiThrottle apps and |Engine Driver|. Note that this must be enclosed in quotes "".

description = A human-friendly description of the turnout/point that will appear in WiThrottle apps and 

See above for information on installing the servo hardware (it is the same as for a turnout/point).

The myAutomation.h file needs to be altered so that the |EX-CS| knows about each servo.

|EX-R| supports two methods of controlling servos that are not related to turnouts/points:

 supports two methods of controlling servos that are not related to turnouts/points:

The ``SERVO_SIGNAL`` directive defines a servo based signal in |EX-R| to drive semaphore type signals as part of sequences or routes, or simply be set via a signal or similar.

 to drive semaphore type signals as part of sequences or routes, or simply be set via a signal or similar.

Similar to pin based signals, servo signals are controlled by the ID of the red pin only.

Unlike servo based turnouts/points, there is no ID or description (they don't appear in throttles), and they use the "Bounce" profile with no other options available at the present time:

Unlike servo based turnouts/points, there is no ID or description (they don’t appear in throttles), and they use the “Bounce” profile with no other options available at the present time:

// Example
SERVO_SIGNAL(102, 400, 250, 100)

/* A simple example using the third control pins of the first
PCA9685 connected to the CommandStation would be: */

**vpin** = The ID of the pin the servo is connected to, which would typically be the VPin ID of the PCA9685 controller board.

 = The ID of the pin the servo is connected to, which would typically be the VPin ID of the PCA9685 controller board.

**redpos** = The angle to which the servo will move to for the red position.

 = The angle to which the servo will move to for the red position.

**amberpos** = The angle to which the servo will move to for the amber position.

 = The angle to which the servo will move to for the amber position.

**greenpos** = The angle to which the servo will move to for the green position.

 = The angle to which the servo will move to for the green position.

The ``SERVO`` and ``SERVO2`` directives allow for servos to be used in various automations within |EX-R|.

 directives allow for servos to be used in various automations within 

Note that unlike a ``SERVO_TURNOUT`` these are not definitions that appear within WiThrottle apps, |Engine Driver|, or |JMRI|, but are instead actions designed to be used within |EX-R| automations.

As per the |EX-R| reference, these are defined with the following syntax:

**position** = The angle to which the servo will move when the turnout/point is thrown (refer below for further detailed information).

 = The angle to which the servo will move when the turnout/point is thrown (refer below for further detailed information).

**profile** = There are five profiles to choose from that determine the speed at which a servo will move: Instant, Fast, Medium, Slow, and Bounce.

 = There are five profiles to choose from that determine the speed at which a servo will move: Instant, Fast, Medium, Slow, and Bounce.

**duration** = The time (in milliseconds (ms)) for the servo to be actively rotating.

 = The time (in milliseconds (ms)) for the servo to be actively rotating.

// Example
AT(164)
SERVO(101, 400, Fast)
DONE

AFTER(164)
SERVO(101, 100, Slow)
DONE

/* As an example, consider a lineside worker that needs to be moved away
from the track when a train approaches, which is controlled by an infrared
sensor.
The SERVO is attached to VPin 101 (second control pin on first PCA9685),
with a sensor attached to VPin 164 (first pin on the first MCP23017):
This tells EXRAIL that when the sensor at VPin 164 is activated, the
lineside worker moves quickly back from the track for safety, and then
after the sensor has been deactivated, he can leisurely move back to his
working position (no one wants to rush back to work right?). */

Place IR Infrared or Optical Sensor's Output wire on Dpins 22, 23, 24 ... 49. Plus one wire to GND and a third wire to 5v.

Place IR Infrared or Optical Sensor’s Output wire on Dpins 22, 23, 24 … 49. Plus one wire to GND and a third wire to 5v.

.. image:: /_static/images/ir-sensor/mega-with-ir-sensor.png
   :alt: IR Sensor connected to Arduino mega

If you need more sensors then there are available pins on the Mega, you use one or more :doc:`/reference/hardware/gpio-module`

If you need more sensors then there are available pins on the Mega, you use one or more 

.. image:: /_static/images/ir-sensor/mega-with-io-expander-and-ir-sensor.png
   :alt: IR Sensor connected to Arduino mega via IO Expander

You don't actually require anything special to be added to myAutomation.h in advance of using them in an sequence.

You don’t actually require anything special to be added to myAutomation.h in advance of using them in an sequence.

Handling sensors in sequences is made easy because |EX-R| throws away the concept of interrupts (“oh… sensor 22 has been detected… which loco was that and whatever do I do now?”) and instead has the sequences work on the basis of “do nothing, maintain speed until sensor 22 triggers, and then carry on in the script”.

 throws away the concept of interrupts (“oh… sensor 22 has been detected… which loco was that and whatever do I do now?”) and instead has the sequences work on the basis of “do nothing, maintain speed until sensor 22 triggers, and then carry on in the script”.

Sensor numbers are direct references to VPINs (virtual pin numbers) in the Hardware Abstraction Layer. For a Mega onboard GPIO pin, this is the same as the digital pin number. Other pin ranges refer to I/O expanders etc.

Hall effect sensors work for some layouts, but beware of how you detect the back end of a train approaching the buffers in a siding, or knowing when the last car has cleared a crossing.

|EX-CS| allows for sensors that are **Active Low or Active High**. This is particularly important for IR sensors that have been converted to detect by broken beam, rather than reflection. By making the sensor number negative, the sensor state is inverted. e.g. ``AT(-22)``.

. This is particularly important for IR sensors that have been converted to detect by broken beam, rather than reflection. By making the sensor number negative, the sensor state is inverted. e.g. 

Sensors with ID's 0 to 255 may be LATCHED/UNLATCHED in your script. If a sensor is latched on by the script, it can only be set off by the script… so ``AT(22) LATCH(22)`` for example effectively latches the sensor 22 on when detected once.

Sensors with ID’s 0 to 255 may be LATCHED/UNLATCHED in your script. If a sensor is latched on by the script, it can only be set off by the script… so 

 for example effectively latches the sensor 22 on when detected once.

Sensor polling by |JMRI| is independent of this, and may continue if ``<S>`` commands are used.  However there is now a way of defining |JMRI| sensors from within |EX-R| - see EXRAIL Command Reference - JMRI_SENSOR.

The 16 columns of three pins along the bottom of the module are where you connect the LEDs.

In |EX-CS|, the drivers for the PCA9685 module is already installed, and made available to for use as pin numbers 100-115.

, the drivers for the PCA9685 module is already installed, and made available to for use as pin numbers 100-115.

The myAutomation.h file needs to be altered so that the |EX-CS| knows about each Signal.

// always use the first red_pin as the signal_id for All signal color changes)
SIGNAL(106, 0, 107) // Red, Amber, Green For turnout/point 1

// Use the first Red vpin# as the signal_id for All Signal color changes
// Use this to Combine the two commands Servo_Turnout and Signal above into One Function
SERVO_SIGNAL(106, 400, 0, 205) //  Red vpin 106 for turnout/point 1, Thrown=Red, Close = Green

See the :doc:`getting-started` page or click the 'Next' button to learn how to create automation sequences.

 page or click the ‘Next’ button to learn how to create automation sequences.

Duplicate explicit target name: "signals via the servo_signal directive".

Duplicate explicit target name: “signals via the servo_signal directive”.

Duplicate explicit target name: "animations via the servo or servo2 directives".

Duplicate explicit target name: “animations via the servo or servo2 directives”.

`LOW - Fix sensor IDs in diagram to match example <https://github.com/DCC-EX/dcc-ex.github.io/issues/419>`_

EXRAIL is way to define sequences to execute on your EX-CommandStation. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

A variety of |EX-R| sequences that illustrate function and usage of five objects are shown below. The :doc:`/big-picture/big-picture` section of this web site also contains a number of more elaborate and complex examples.

 sequences that illustrate function and usage of five objects are shown below. The 

 section of this web site also contains a number of more elaborate and complex examples.

A three aspect signal connected to Mega2560 I/O pins 22 (red), 23 (amber), and 24 (green)

A two aspect signal connected to Mega2560 I/O pins 25 (red) and 26 (green)

LEDs connected to pins vpins 164 and 165 of an MCP23017 I/O extender

Active low IR sensors connected to Mega2560 I/O pins 40 through 46

Turning track power on or off in |EX-CS| version 5 (the current Production version) is performed respectively by either the |EX-R| command ``POWERON`` or ``POWEROFF``; or in EX-CommandStation's native language using the command line, ``<1>`` or ``<0>``.

 version 5 (the current Production version) is performed respectively by either the 

; or in EX-CommandStation’s native language using the command line, 

Users of previous EX-CommandStation versions can switch track power on or off via |EX-R|;
``SETUP("<1>")``  for on or ``SETUP("<0>")`` for off;  or in EX-CommandStation's native language, ``<1>`` or ``<0>``

Users of previous EX-CommandStation versions can switch track power on or off via 

Another approach for powering up the track is to assign a speed to a loco in a sequence and power will automatically turn on.  |EX-R| cleverly knows that power must be on before a locomotive can move so it turns track power on when the sequence is executed.

Another approach for powering up the track is to assign a speed to a loco in a sequence and power will automatically turn on.  

 cleverly knows that power must be on before a locomotive can move so it turns track power on when the sequence is executed.

// VER 5 No Implied AUTOSTART occurs and must be added to the myAutomation.h file
// VER 4 The implied AUTOSTART results in the automatic execution
// of the code in the myAutomation.h file thus the sequence is run each time
// the EX-CommandStation boots up.
AUTOSTART       // required in version 5 or later
SETLOCO(9999)   // select loco 9999
SPEED(0)        // set the speed to 0.  This will turn the track power on
DONE

// Sample default roster entry, if added (loco 0) it will become the default for all manually acquired locos
ROSTER(0,"Default","Lights/Bell/*Horn/F3/F4/F5/F6/F7/F8/F9/10/F11/F12/F13/F14/F15/F16/F17/F18/F19/F20/F21/F22/F23/F24/F25/F26/27/F28/F29/F30/F31")
// Sample Engines with DCC decoders have from a few to many F-Keys

// Version 5.0+ TrackManager, Sample Analog DC Engines with No decoder, either no F-keys, or just One identifing it as DC only
ROSTER (  1,"Eng 1", "")   // Address 1, Eng 1, Function keys None
ROSTER ( 25,"PE 25", "DC") // Address 25, PE 25, Function keys just One 'DC' Identifing it as Analog DC Cab

// Example

/* An example definition for a servo connected to the second control pins of the first PCA9685
connected to the CommandStation, using the slow profile for prototypical operation:

The SERVO_TURNOUT parameters mean:
'200' = Unique ID within the CommandStation (note these are shared across turnouts/points,
        sensors, and outputs)
'101' = The ID of the pin the servo is connected to, which would typically be the VPin ID
        of the PCA9685 controller board
'450' = The angle to which the servo will move when the turnout/point is thrown
'110' = The angle to which the servo will move when the turnout/point is closed
'Slow' = There are five profiles to choose from that determine the speed at which a
        turnout/point will move: Instant, Fast, Medium, Slow, and Bounce (note we don't
        recommend Bounce for a turnout/point definition).
"The description" = A human-friendly description of the turnout/point that will appear in
        WiThrottle apps and |Engine Driver|.*/

A typical Route might be used to set a series of turnouts in response to a single button in a throttle.
The |EX-R| instructions to do this might look like

The 

// This is my coal yard to engine shed route
ROUTE(1,"Coal Yard exit")     // appears in the throttle
  THROW(1)   // throw turnout onto coal yard siding
  CLOSE(7)   // close turnout for engine shed
  DONE    // that's all folks!

SIGNAL(22,23,24)  // see the Defining Signals section
SIGNAL(25,0,26)   //      below for details

ROUTE(1,"Coal Yard exit")
   RED(22)
   THROW(1)
   CLOSE(7)
   DELAY(5000)  // this is a 5 second wait
   GREEN(25)
   DONE

By intercepting a turnout change command, it's easy to automatically adjust signals or
automatically switch an adjacent facing turnout. Use an ``ONTHROW`` or ``ONCLOSE`` keyword to detect a particular turnout change:

By intercepting a turnout change command, it’s easy to automatically adjust signals or
automatically switch an adjacent facing turnout. Use an 

ONTHROW(8)  // When turnout 8 is thrown,
   THROW(9)  // must also throw the facing turnout
   RED(22)
   DELAY(2000)
   GREEN(25)
   DONE

ONCLOSE(8)  // When turnout 8 is closed
  CLOSE(9)
  RED(25)
  DELAY(2000)
  GREEN(22)
  DONE

This normally takes place in a timed loop, for example alternate flashing of a fire engine's lights. To do this use a SEQUENCE.

This normally takes place in a timed loop, for example alternate flashing of a fire engine’s lights. To do this use a SEQUENCE.

SEQUENCE(66)
  SET(164)   // sets output 164 HIGH
  RESET(165) // sets output 165 LOW
  DELAY(500)   // wait 0.5 seconds
  SET(165)   // swap the lights
  RESET(164)
  FOLLOW(66)  // follow sequence 66 continuously

Note, however, that this sequence will not start automatically: it must be started during the startup process (see later) using ``START(66)``.

Note, however, that this sequence will not start automatically: it must be started during the startup process (see later) using 

Start with something as simple as a single loop of track with a station and a sensor (connected to pin 40 for this example) at the point where you want the train to stop.

.. image:: /_static/images/exrail/Example_4_diagram.png
   :alt:  Simple example 4

Using an ``AUTOMATION`` keyword means that this automation will appear in the throttle so you can drive the train manually, and then hand it over to the automation at the press of a button.

 keyword means that this automation will appear in the throttle so you can drive the train manually, and then hand it over to the automation at the press of a button.

\* Technically, an automation can independently run multiple locos along the same path through the layout, but this is discussed later...

AUTOMATION(4,"Round in circles")
   FWD(50)   // move forward at DCC speed 50 (out of 127)
   AT(40)     // when you get to sensor on pin (40)
   STOP      // stop the train
   DELAYRANDOM(5000,20000) // delay somewhere between 5 and 20 seconds
   FWD(30)   // start a bit slower
   AFTER(40)  // until sensor on pin 40 has been passed
   FOLLOW(4) // and continue to follow the automation

The instructions are followed in sequence by the loco given to it; the ``AT`` command just leaves the loco running until that sensor is detected.

The instructions are followed in sequence by the loco given to it; the 

 command just leaves the loco running until that sensor is detected.

Notice that this automation does not specify the loco address. If you drive a loco with the throttle and then hand it over to this automation, then the automation will run with the loco you last drove.

Adding a station signal to the loop script is extremely simple, but it does require a mind-shift for some modellers who like to think in terms of signals being in control of trains!

|EX-R| takes a different approach, by animating the signals as part of the driving script. Thus set a signal GREEN before moving off (and allow a little delay for the driver to react) and RED after you have passed it.

 takes a different approach, by animating the signals as part of the driving script. Thus set a signal GREEN before moving off (and allow a little delay for the driver to react) and RED after you have passed it.

SIGNAL(22,23,24)  // see the Defining Signals section above for details
   AT(40)    // when you get to sensor on pin (40)
   STOP      // Stop the train
   GREEN(22)    // set signal #22 to Green
   DELAY(2500)  // This is not Formula1!
   FWD(30)    // start a bit slower
   RED(22)    // set signal #22 to Red
   FOLLOW(4)  // and continue to follow the automation

.. image:: /_static/images/exrail/Example_6_diagram.png

Wait between 10 and 20 seconds for the guard to stop chatting up the girl in the ticket office.

Notice that the sensors at A and B are near the ends of the track (allowing for braking distance, but don't care about train length or whether the engine is at the front or back.) We have wired sensor A on pin 41, and sensor B on pin 42 for this example.

Notice that the sensors at A and B are near the ends of the track (allowing for braking distance, but don’t care about train length or whether the engine is at the front or back.) We have wired sensor A on pin 41, and sensor B on pin 42 for this example.

SEQUENCE(13)
  DELAYRANDOM(10000,20000) // random wait between 10 and 20 seconds
  FWD(50)
  AT(42) // sensor 42 is at the far end of platform B
  STOP
  DELAY(15000)
  REV(20) // Reverse at DCC speed 20 (out of 127)
  AT(41) // far end of platform A
  STOP
  FOLLOW(13) // follows sequence 13 again… forever

Note a SEQUENCE is exactly the same as an AUTOMATION except that it does NOT appear in the throttle.

When the Command Station is powered up or reset, |EX-R| starts operating at the beginning of the file.  For this sequence we need to set a loco address and start the sequence:

 starts operating at the beginning of the file.  For this sequence we need to set a loco address and start the sequence:

SENDLOCO(3,13) // Start sequence 13 using loco 3
DONE           // This marks the end of the startup process

The sequence can also be started from a |serial monitor| with the command ``</ START 3 13>``.

If you have multiple separate sections of track which do not require inter-train cooperation, you may add many more separate sequences and they will operate independently.

Although the above is trivial, the routes are designed to be independent of the loco address so that we can have several locos following the same route at the same time (not in the end to end example above!), perhaps passing each other or crossing over with trains on other routes.

The example above assumes that loco 3 is sitting on the track and pointing in the right direction. A bit later you will see how to script an automatic process to take whatever loco is placed on the programming track, and send it on its way to join in the fun!

So what about routes that cross or share single lines (passing places etc)?
Let's add a passing place between A and B. S= Sensors, T=Turnout
number. So now our route looks like this:

Let’s add a passing place between A and B. S= Sensors, T=Turnout

.. image:: /_static/images/exrail/Example_7a_diagram.png

Assuming that you have defined your turnouts as per :ref:`exrail/exrail-command-reference:turnout/point objects - definition and control`

SEQUENCE(11)
   DELAYRANDOM(10000,20000) // random wait between 10 and 20 seconds
   CLOSE(1)
   CLOSE(2)
   FWD(30)
   AT(42) // sensor 42 is at the far end of platform B
   STOP
   DELAY(15000)
   THROW(2)
   THROW(1)
   REV(20)
   AT(41)
   STOP
   FOLLOW(11) // follows sequence 11 again… forever

All well and good for one loco, but with 2 (or even 3) on this track we need some rules. The principle behind this is

To enter a section of track that may be shared, you must RESERVE it. If you cant reserve it because another loco already has, then you will be stopped and the script will wait until such time as you can reserve it. When you leave a shared section you must free it.

Each 'section' is merely a logical concept, there are no electronic section breaks in the track. You may have up to 255 sections (more can be supported by a code mod if required).

Each ‘section’ is merely a logical concept, there are no electronic section breaks in the track. You may have up to 255 sections (more can be supported by a code mod if required).

So we will need some extra sensors (hardware required) and some logical blocks (all in the mind!):

.. image:: /_static/images/exrail/Example_7b_diagram.png

We can use this diagram to plan routes. When we do so, it will be easier to imagine 4 separate mini routes, each passing from one block to the next. Then we can chain them together to form a full route, but also start from any block.

So… lets take a look at the routes now. For convenience I have used route numbers that help remind us what the route is for.

SEQUENCE(12) // From block 1 to block 2
   RESERVE(2) // we wish to enter block 2… so wait for it
   CLOSE(1) // Now we “own” the block, set the turnout
   FWD(30) // and proceed forward
   AFTER(43) // Once we have reached AND passed sensor 43
   FREE(1) // we no longer occupy block 1
   AT(44) // When we get to sensor 44
   FOLLOW(23) // follow route from block 2 to block 3

SEQUENCE(23) // Travel from block 2 to block 3
   RESERVE(3) // will STOP if block 3 occupied
   CLOSE(2) // Now we have the block, we can set turnouts
   FWD(20) // we may or may not have stopped at the RESERVE
   AT(42) // sensor 2 is at the far end of platform B
   STOP
   FREE(2)
   FOLLOW(34)

SEQUENCE(34) // you get the idea
   RESERVE(4)
   THROW(2)
   REV(20)
   AFTER(45)
   FREE(3)
   AT(46)
   FOLLOW(41)

SEQUENCE(41)
   RESERVE(1)
   THROW(1)
   REV(20)
   AT(41)
   STOP
   FREE(4)
   FOLLOW(12) // follows Route 12 again… forever

Does that look long? Worried about memory on your Arduino…. Well the script above takes about 100 BYTES of program memory and no dynamic SRAM!

If you follow this example carefully, you'll see it allows for up to 3 trains at a time, because one of them will always have somewhere to go. Notice that there is a common theme to this…

If you follow this example carefully, you’ll see it allows for up to 3 trains at a time, because one of them will always have somewhere to go. Notice that there is a common theme to this…

RESERVE where you want to go. If you are moving and the reserve fails, your loco will STOP and the reserve waits for the block to become available. \*These waits and the manual WAITS do not block the Arduino process… DCC and the other locos continue to follow their routes!

RESERVE where you want to go. If you are moving and the reserve fails, your loco will STOP and the reserve waits for the block to become available. *These waits and the manual WAITS do not block the Arduino process… DCC and the other locos continue to follow their routes!

Set the points to enter the reserved area. Do this ASAP, as you may be still moving towards them.

Free off your previous reserve as soon as you have fully left the block.

In addition, it is possible to take decisions based on blocks reserved by other trains. The ``IFRESERVE(block)`` can be used to reserve a block if it's not already reserved by some other train, or skip to the matching ENDIF. For example, this allows a train to choose which platform to stop at based on prior occupancy. It is features like this that allow for more interesting and unpredictable automations.

In addition, it is possible to take decisions based on blocks reserved by other trains. The 

 can be used to reserve a block if it’s not already reserved by some other train, or skip to the matching ENDIF. For example, this allows a train to choose which platform to stop at based on prior occupancy. It is features like this that allow for more interesting and unpredictable automations.

Starting the system is tricky, because we need to place the trains in a suitable position and set them going. We need to have a starting position for each loco, and reserve the block(s) it needs to keep other trains from crashing into it.

This EXRAIL version isn't ready to handle locos randomly placed on the layout after a power down!

This EXRAIL version isn’t ready to handle locos randomly placed on the layout after a power down!

For a known set of locos, the easiest way is to define the startup process at the beginning of the script. E.g. for two engines, one at each station.

// ensure all blocks are reserved as if the locos had arrived there
RESERVE(1) // start with a loco in block 1
RESERVE(3) // and another in block 3
SENDLOCO(3,12) // send Loco DCC addr 3 on to route 12
SENDLOCO(17,34) // send loco DCC addr 17 to route 34
DONE // don't drop through to the first sequence definition that follows in the script file

Some interesting points about the startup:

* You don't need to set turnouts, because each route is setting them as required.
* Signals default to RED on power up, and get turned GREEN when a route clears them.

You don't need to set turnouts, because each route is setting them as required.

You don’t need to set turnouts, because each route is setting them as required.

Signals default to RED on power up, and get turned GREEN when a route clears them.

|EX-R| can switch a track section between programming and mainline.

Here for example is a launch sequence that has no predefined locos but allows locos to be added at station 1 while the system is in motion. Let's assume that the track section at Station1 is isolated and connected to the programming track power supply. Also that we have a 'launch' button connected where sensor 17 would be and an optional signal (i.e. 3 LEDs) on the control panel connected where signal 27 would be.

Here for example is a launch sequence that has no predefined locos but allows locos to be added at station 1 while the system is in motion. Let’s assume that the track section at Station1 is isolated and connected to the programming track power supply. Also that we have a ‘launch’ button connected where sensor 17 would be and an optional signal (i.e. 3 LEDs) on the control panel connected where signal 27 would be.

SEQUENCE(99)
   SIGNAL(22,23,24)
   RED(22)   // indicate launch not ready
   AFTER(30) // user presses and releases launch button
   UNJOIN    // separate the programming track from main
   AMBER(22) // Show amber, user may place loco
   AFTER(30) // user places loco on track and presses “launch” again
   READ_LOCO // identify the loco
   GREEN(22) // show green light to user
   JOIN      // connect prog track to main
   START(12) // send loco off along route 12
   FOLLOW(99) // keep doing this for another launch

The READ_LOCO reads the loco address from the PROG track and the current route takes on that loco. By altering the script slightly and adding another sensor, it's possible to detect which way the loco sets off and switch the code logic to send it in the correct direction by using the ``INVERT_DIRECTION`` instruction so that this locos FWD and REV commands are reversed. (easily done with diesels!)

The READ_LOCO reads the loco address from the PROG track and the current route takes on that loco. By altering the script slightly and adding another sensor, it’s possible to detect which way the loco sets off and switch the code logic to send it in the correct direction by using the 

 instruction so that this locos FWD and REV commands are reversed. (easily done with diesels!)

The previous pages have only been a small taste of what is possible with |EX-R|.

The previous pages have only been a small taste of what is possible with 

To continue to learn more about it, click the :guilabel:`Next` button to see some more :doc:`/exrail/tips`, and you can also see the :doc:`/exrail/exrail-command-reference` to explore the full capabilities.

|EX-CS| provides full automation and accessory control through the Extended Railroad Automation Instruction Language (|EX-R|).

 provides full automation and accessory control through the Extended Railroad Automation Instruction Language (

This page includes a reference for all available |EX-R| commands.

CAPITALISED words - These are EXRAIL commands and are case sensitive

lowercase words within brackets/braces ``()`` - These are EXRAIL parameters that must be provided, with multiple parameters separated by a comma ``,``, for example ``SEQUENCE(id)`` or ``DELAYRANDOM(min_delay, max_delay)``

 - These are EXRAIL parameters that must be provided, with multiple parameters separated by a comma 

Quoted ``"text"`` - Text within quote marks ``""`` are used as descriptions, and must include the quote characters, for example ``ROUTE(id, "description")`` becomes ``ROUTE(1, "This is the route description")``

 are used as descriptions, and must include the quote characters, for example 

Square brackets ``[]`` - Parameters within square brackets ``[]`` are optional and may be omitted. If specifying these parameters, do not include the square brackets themselves, for example ``ALIAS(name[, value])`` becomes ``ALIAS(MY_ALIAS)`` or ``ALIAS(MY_ALIAS, 3)``

 are optional and may be omitted. If specifying these parameters, do not include the square brackets themselves, for example 

``|`` - Use of the ``|`` character means you need to provide one of the provided options only, for example ``<D POWER ON|OFF>`` becomes either ``<D POWER ON>`` or ``<D POWER OFF>``

 character means you need to provide one of the provided options only, for example 

COMMANDS are case sensitive. i.e. they must be in uppercase. Text parameters that you provide (aliases,  descriptions) are not

*AUTOMATION*, *ROUTE*, and *SEQUENCE* use the same ID number space, so a ``FOLLOW(n)`` command can be used for any of them

Sensors and outputs used by AT/AFTER/SET/RESET/LATCH/UNLATCH/SERVO/IF/IFNOT refer directly to Arduino pins, and those handled by |I2C| expansion (as virtual pins or vpins).

Sensors and outputs used by AT/AFTER/SET/RESET/LATCH/UNLATCH/SERVO/IF/IFNOT refer directly to Arduino pins, and those handled by 

Signals also refer directly to pins, and the signal ID (for RED/AMBER/GREEN) is always the same as the RED signal pin

It's OK to use sensor IDs that have no physical item in the layout. These can only be LATCHed, tested (IF/IFNOT), or UNLATCHed in the sequences. If a sensor is latched by the sequence, it can only be unlatched by the sequence so ``AT(35) LATCH(35)`` for example, effectively latches sensor 35 on when detected once

It’s OK to use sensor IDs that have no physical item in the layout. These can only be LATCHed, tested (IF/IFNOT), or UNLATCHed in the sequences. If a sensor is latched by the sequence, it can only be unlatched by the sequence so 

 for example, effectively latches sensor 35 on when detected once

All IDs used in commands and functions will be numbers, or an ALIAS name if configured

Most IDs simply need to be unique, however RESERVE/FREE and LATCH/UNLATCH must be in the range 0 - 255

There are four uses of ID numbers in EXRAIL:

- AUTOMATION, ROUTE, and SEQUENCE IDs
- Turnout/Point IDs
- Vpins - Includes physical pins on the EX-CommandStation, virtual pins (Vpins) on I/O expander modules, and virtual pins that have no physical presence
- Virtual block IDs as used in RESERVE/FREE

Therefore, you can have an AUTOMATION, a turnout/point, a Vpin, and a virtual block all defined with the same ID without issue as these will not relate to each other. This is probably a great reason to consider aliases to avoid confusion.

Vpins - Includes physical pins on the EX-CommandStation, virtual pins (Vpins) on I/O expander modules, and virtual pins that have no physical presence

Every |EX-R| automation/route/sequence, event handler, and conditional statement must be terminated by one of these three directives.

 automation/route/sequence, event handler, and conditional statement must be terminated by one of these three directives.

On this page, you will see various references to the use of ``DONE``, ``ENDIF``, and ``FOLLOW()`` which can be confusing, so refer to this quick list to help understand the context in which each of these should be used:

 which can be confusing, so refer to this quick list to help understand the context in which each of these should be used:

Every conditional statement (all directives starting with the word ``IF``) must be terminated by ``ENDIF``

Every conditional statement (all directives starting with the word 

Every group of commands within a ROUTE, AUTOMATION, or SEQUENCE must be terminated by either ``DONE`` or ``FOLLOW(id)``

Every group of commands within a ROUTE, AUTOMATION, or SEQUENCE must be terminated by either 

Every event handler (all directives starting with the word ``ON``) must be terminated by ``DONE``

  // Valid use of a ROUTE with a nested IF statement
  ROUTE(1)
    IF(46)
      // Things to be done when sensor ID 46 is active
    ELSE
      // Things to be done when sensor ID 46 is inactive
    ENDIF
    DONE

  // Validate use of a sequence that needs to run continuously
  // DONE is not required in this instance
  SEQUENCE(2)
    IF(46)
    ELSE
    ENDIF
    FOLLOW(2)

  // Validate use of a turnout event handler for turnout ID 200
  ONCLOSE(200)
    // Things to be done when turnout 200 is closed
    DONE

// Valid use of a ROUTE with a nested IF statement
ROUTE(1)
  IF(46)
    // Things to be done when sensor ID 46 is active
  ELSE
    // Things to be done when sensor ID 46 is inactive
  ENDIF
  DONE

// Validate use of a sequence that needs to run continuously
// DONE is not required in this instance
SEQUENCE(2)
  IF(46)
  ELSE
  ENDIF
  FOLLOW(2)

// Validate use of a turnout event handler for turnout ID 200
ONCLOSE(200)
  // Things to be done when turnout 200 is closed
  DONE

When defining conditions, the behavior of ``AT()`` and ``AFTER()`` is quite different to using conditional ``IF()`` statements.

This applies to all directives starting with ``AT``, ``AFTER``, and ``IF``.

When using ``AT()`` or ``AFTER()``, this is a blocking activity, meaning the sequence of activities will not progress beyond this particular directive unless the condition is met.

, this is a blocking activity, meaning the sequence of activities will not progress beyond this particular directive unless the condition is met.

When using ``IF`` conditional statements, these will not block if the condition is not met, allowing the sequence of activities to continue.

 conditional statements, these will not block if the condition is not met, allowing the sequence of activities to continue.

  // Use of AT() to prevent doing anything until a sensor is activated
  // This sequence will continue to run until the sensor is activated, in which case those activities will be performed, and it will end
  SEQUENCE(1)
    AT(46)
      // Things to do when sensor 46 is activated
    DONE

  // Use of IF() to continuously monitor a number of sensors
  // This sequence will continually loop to monitor the sensors, meaning the activities related to each sensor are not blocked by the state of other sensors
    IF(46)
      // Things to do if sensor 46 is activated
    ENDIF
    IF(47)
      // Things to do if sensor 47 is activated
    ENDIF
    IF(48)
      // Things to do if sensor 48 is activated
    ENDIF
    FOLLOW(2)

// Use of AT() to prevent doing anything until a sensor is activated
// This sequence will continue to run until the sensor is activated, in which case those activities will be performed, and it will end
SEQUENCE(1)
  AT(46)
    // Things to do when sensor 46 is activated
  DONE

// Use of IF() to continuously monitor a number of sensors
// This sequence will continually loop to monitor the sensors, meaning the activities related to each sensor are not blocked by the state of other sensors
  IF(46)
    // Things to do if sensor 46 is activated
  ENDIF
  IF(47)
    // Things to do if sensor 47 is activated
  ENDIF
  IF(48)
    // Things to do if sensor 48 is activated
  ENDIF
  FOLLOW(2)

Various diagnostic and control commands have been added to control and interact with |EX-R|, including the various sequences and objects once they have been defined in myAutomation.h and uploaded to the |EX-CS|.

Various diagnostic and control commands have been added to control and interact with 

, including the various sequences and objects once they have been defined in myAutomation.h and uploaded to the 

These commands can be run interactively via the serial console or over Ethernet/WiFi if using a throttle or client that provides a suitable interface for sending native DCC-EX commands.

``<D EXRAIL state>`` - Enable or disable EXRAIL sequence logging

When the |EX-CS| is connected to a |serial monitor|, |EX-R| sequence logging can be turned on or off (Enabled or Disabled).

 sequence logging can be turned on or off (Enabled or Disabled).

.. collapse:: For example: (click to show)

  Example output from :ref:`exrail/examples:Point to Point Shuttle` running SEQUENCE(13) with loco ID 18:

  .. code-block:: cpp

    <D EXRAIL ON>
    <p1 MAIN>
    PPA1
    <1 18 0 178 0>
    <* EXRAIL Sensor 42 hit *>
    <* EXRAIL drive 18 0 1 *>
    <1 18 0 128 0>
    <* EXRAIL drive 18 20 0 *>
    <1 18 0 20 0>
    <* EXRAIL Sensor 41 hit *>
    <* EXRAIL drive 18 0 0 *>
    <1 18 0 0 0>
    <* EXRAIL begin(13) *>
    <* EXRAIL drive 18 50 1 *>

Example output from :ref:`exrail/examples:Point to Point Shuttle` running SEQUENCE(13) with loco ID 18:

  <D EXRAIL ON>
  <p1 MAIN>
  PPA1
  <1 18 0 178 0>
  <* EXRAIL Sensor 42 hit *>
  <* EXRAIL drive 18 0 1 *>
  <1 18 0 128 0>
  <* EXRAIL drive 18 20 0 *>
  <1 18 0 20 0>
  <* EXRAIL Sensor 41 hit *>
  <* EXRAIL drive 18 0 0 *>
  <1 18 0 0 0>
  <* EXRAIL begin(13) *>
  <* EXRAIL drive 18 50 1 *>

<D EXRAIL ON>
<p1 MAIN>
PPA1
<1 18 0 178 0>
<* EXRAIL Sensor 42 hit *>
<* EXRAIL drive 18 0 1 *>
<1 18 0 128 0>
<* EXRAIL drive 18 20 0 *>
<1 18 0 20 0>
<* EXRAIL Sensor 41 hit *>
<* EXRAIL drive 18 0 0 *>
<1 18 0 0 0>
<* EXRAIL begin(13) *>
<* EXRAIL drive 18 50 1 *>

Pauses **ALL** EXRAIL automation activities, including sending an E-STOP to all locos.

 EXRAIL automation activities, including sending an E-STOP to all locos.

Resume **ALL** EXRAIL automation activities, and resumes all locos at the same speed at which they were paused.

 EXRAIL automation activities, and resumes all locos at the same speed at which they were paused.

Example outputs also using :ref:`exrail/examples:Point to Point Shuttle`:

* Leaving right side of the shuttle sequence with speed 50F (forward):

  </>
  <* EXRAIL STATUS
  ID=0,PC=12,LOCO=0 ,SPEED=0F
  ID=1,PC=12,LOCO=18 ,SPEED=50F *>

Leaving right side of the shuttle sequence with speed 50F (forward):

</>
<* EXRAIL STATUS
ID=0,PC=12,LOCO=0 ,SPEED=0F
ID=1,PC=12,LOCO=18 ,SPEED=50F *>

``</ START [loco_addr] route_id>`` - Start route, optionally using specified loco

Starts a new task to send a loco onto a Route, or activate a non-loco Animation or Sequence.

</ start [loco_addr] route_id> - start route, optionally using specified loco

- task_id is an internally generated ID separate from any of the user defined IDs
- the KILL command should only be used when you understand the internals of the exrail task system.  It is not designed to be used in normal running.

task_id is an internally generated ID separate from any of the user defined IDs

the KILL command should only be used when you understand the internals of the exrail task system.  It is not designed to be used in normal running.

``</ RESERVE block_id>`` - Manually reserves a virtual track Block

Manually reserves a virtual track Block, valid IDs are in the range 0 - 255

Manually frees a virtual track Block, valid IDs are in the range 0 - 255.

``</ LATCH vpin>`` - Lock sensor ON, preventing external influence

Lock sensor ON, preventing external influence, valid IDs are in the range 0 - 255.

``</ UNLATCH vpin>`` - Unlock sensor, returning to current external state

Unlock sensor, returning to current external state, valid IDs are in the range 0 - 255.

Refer to the LATCH/UNLATCH commands in the :ref:`exrail/exrail-command-reference:sensors/inputs - reading and responding` section below for further details.

:ref:`exrail/exrail-command-reference:sensors/inputs - reading and responding`

</ unlatch vpin> - unlock sensor, returning to current external state

Aliases assigns names to values. They can go anywhere in the sequence. If a value is not assigned, a unique ID will be assigned based on the alias "name" text.

Aliases assigns names to values. They can go anywhere in the sequence. If a value is not assigned, a unique ID will be assigned based on the alias “name” text.

This is a simple substitution that lets you have readable names for things in your sequence. For example, instead of having to remember the VPin a turnout/point is connected to, give the pin number an alias and refer to it by that name. You can use this to name routes, values, pin numbers, or anything you need.

If you simply need a unique identifier for an object used internally to the sequence, such as a turnout/point, route, automation, or sequence, you don't even need to provide an ID, |EX-R| will generate one automatically when you omit the value parameter. We recommend using this for all your routes, sequences, and other internal objects so you don't have to try to remember or keep a list of numbers you've used. This also prevents you from assigning the same number to more than one object.

If you simply need a unique identifier for an object used internally to the sequence, such as a turnout/point, route, automation, or sequence, you don’t even need to provide an ID, 

 will generate one automatically when you omit the value parameter. We recommend using this for all your routes, sequences, and other internal objects so you don’t have to try to remember or keep a list of numbers you’ve used. This also prevents you from assigning the same number to more than one object.

REMEMBER: IDs for RESERVE/FREE, LATCH/UNLATCH, and pins must be explicitly defined.

To put this another way, if you connect an LED to pin 23 and want to turn it on and off, you have to explicitly set its pin number, so `ALIAS(TOWER_LED, 23)` lets you equate "23" to TOWER_LED. But if you created a route to run your train around an oval, you don't really need to set the number or even know it. Just use `ALIAS(OVAL)` and let EX assign a number internally. If you ever wanted to know what number it assigns, you can enter `<? OVAL>` from the serial monitor with the |EX-CS| running and it will tell you next to "Opcode=". Since this "hash", as it is called, is generated by the alias name word, it is always unique and always the same for that word even if you have not created the alias yet. Fun fact, "OVAL" will always equal 27500.

To put this another way, if you connect an LED to pin 23 and want to turn it on and off, you have to explicitly set its pin number, so 

 lets you equate “23” to TOWER_LED. But if you created a route to run your train around an oval, you don’t really need to set the number or even know it. Just use 

 and let EX assign a number internally. If you ever wanted to know what number it assigns, you can enter 

 running and it will tell you next to “Opcode=”. Since this “hash”, as it is called, is generated by the alias name word, it is always unique and always the same for that word even if you have not created the alias yet. Fun fact, “OVAL” will always equal 27500.

**Must not** be an existing EXRAIL command name or other reserved word.

**Must start** with letters A-Z, a-z, or underscore _ (case sensitive!).

*Parameters:* |BR|
|_| > **name** - name for the Alias.  See rules above |BR|
|_| > **value** - value to insert in place of the Alias

  Defining a pin turnout/point without an alias:

    PIN_TURNOUT(1, 25, "Coal Yard")

  Defining a pin turnout/point with aliases:

    ALIAS(COAL_YARD)
    ALIAS(COAL_YARD_PIN, 25)
    PIN_TURNOUT(COAL_YARD, COAL_YARD_PIN, "Coal Yard")

  Note that you could have used the command `ALIAS(COAL_YARD, 1)` in the example above to explicitly set the number, but unless you have a reason to use specific numbers, let the |EX-CS| do it for you.

  In this simple example, aliases seem like overkill, however consider the case where you need to have the "Coal Yard" turnout/point closed or thrown in various different automation sequences, and you will soon see why it's easier to understand you're throwing the COAL_YARD turnout/point rather than turnout/point ID 12345.

Defining a pin turnout/point without an alias:

  PIN_TURNOUT(1, 25, "Coal Yard")

Defining a pin turnout/point with aliases:

  ALIAS(COAL_YARD)
  ALIAS(COAL_YARD_PIN, 25)
  PIN_TURNOUT(COAL_YARD, COAL_YARD_PIN, "Coal Yard")

Note that you could have used the command `ALIAS(COAL_YARD, 1)` in the example above to explicitly set the number, but unless you have a reason to use specific numbers, let the |EX-CS| do it for you.

In this simple example, aliases seem like overkill, however consider the case where you need to have the "Coal Yard" turnout/point closed or thrown in various different automation sequences, and you will soon see why it's easier to understand you're throwing the COAL_YARD turnout/point rather than turnout/point ID 12345.

ALIAS(COAL_YARD)
ALIAS(COAL_YARD_PIN, 25)
PIN_TURNOUT(COAL_YARD, COAL_YARD_PIN, "Coal Yard")

 in the example above to explicitly set the number, but unless you have a reason to use specific numbers, let the 

In this simple example, aliases seem like overkill, however consider the case where you need to have the “Coal Yard” turnout/point closed or thrown in various different automation sequences, and you will soon see why it’s easier to understand you’re throwing the COAL_YARD turnout/point rather than turnout/point ID 12345.

* :ref:`ACOF`
* :ref:`ACON`
* :ref:`ACTIVATE`
* :ref:`ACTIVATEL`
* :ref:`AFTER`
* :ref:`AFTEROVERLOAD`
* :ref:`AMBER`
* :ref:`ANOUT`
* :ref:`ASPECT`
* :ref:`AT`
* :ref:`ATGTE`
* :ref:`ATLT`
* :ref:`ATTIMEOUT`
* :ref:`ATTIMEOUT1`
* :ref:`ATTIMEOUT2`
* :ref:`AUTOMATION`
* :ref:`AUTOSTART`
* :ref:`BLINK`
* :ref:`BROADCAST`
* :ref:`CALL`
* :ref:`CLEAR_ALL_STASH`
* :ref:`CLEAR_STASH`
* :ref:`CLOSE`
* :ref:`CONFIG_SERVO`
* :ref:`DCCACTIVATE`
* :ref:`DCCEX_SIGNAL`
* :ref:`DCC_SIGNAL`
* :ref:`DCC_TURNTABLE`
* :ref:`DEACTIVATE`
* :ref:`DEACTIVATEL`
* :ref:`DELAY`
* :ref:`DELAYMINS`
* :ref:`DELAYMS`
* :ref:`DELAYRANDOM`
* :ref:`DISABLE_PROG`
* :ref:`DONE`
* :ref:`DRIVE`
* :ref:`ELSE`
* :ref:`ENDEXRAIL`
* :ref:`ENDIF`
* :ref:`ENDTASK`
* :ref:`EXRAIL`
* :ref:`ESTOP`
* :ref:`EXTT_TURNTABLE`
* :ref:`FADE`
* :ref:`FOFF`
* :ref:`FOLLOW`
* :ref:`FON`
* :ref:`FORGET`
* :ref:`FREE`
* :ref:`FTOGGLE`
* :ref:`FWD`
* :ref:`GREEN`
* :ref:`EXRAIL_HAL`
* :ref:`HAL_IGNORE_DEFAULTS`
* :ref:`IF`
* :ref:`IFAMBER`
* :ref:`IFCLOSED`
* :ref:`IFGREEN`
* :ref:`IFGTE`
* :ref:`IFLOCO`
* :ref:`IFLT`
* :ref:`IFNOT`
* :ref:`IFRANDOM`
* :ref:`IFRE`
* :ref:`IFRED`
* :ref:`IFRESERVE`
* :ref:`IFTHROWN`
* :ref:`IFTIMEOUT`
* :ref:`IFTTPOSITION`
* :ref:`INVERT_DIRECTION`
* :ref:`IO_NO_HAL`
* :ref:`JMRI_SENSOR`
* :ref:`JOIN`
* :ref:`KILLALL`
* :ref:`LATCH`
* :ref:`LCC`
* :ref:`LCCX`
* :ref:`LCD`
* :ref:`LCN`
* :ref:`MESSAGE`
* :ref:`MOVETT`
* :ref:`NEOPIXEL`
* :ref:`NEOPIXEL_SIGNAL`
* :ref:`ONACOF`
* :ref:`ONACON`
* :ref:`ONACTIVATE`
* :ref:`ONACTIVATEL`
* :ref:`ONAMBER`
* :ref:`ONBUTTON`
* :ref:`ONCHANGE`
* :ref:`ONCLOCKMINS`
* :ref:`ONCLOCKTIME`
* :ref:`ONCLOSE`
* :ref:`ONDEACTIVATE`
* :ref:`ONDEACTIVATEL`
* :ref:`ONGREEN`
* :ref:`ONLCC`
* :ref:`ONOVERLOAD`
* :ref:`ONRED`
* :ref:`ONROTATE`
* :ref:`ONSENSOR`
* :ref:`ONTHROW`
* :ref:`ONTIME`
* PAD
* :ref:`PARSE`
* :ref:`PAUSE`
* :ref:`PICKUP_STASH`
* :ref:`PIN_TURNOUT`
* :ref:`PLAYSOUND`
* :ref:`POM`
* :ref:`POWEROFF`
* :ref:`POWERON`
* :ref:`PRINT`
* :ref:`RANDWAIT`
* :ref:`READ_LOCO`
* :ref:`RED`
* :ref:`RESERVE`
* :ref:`RESET`
* :ref:`RESUME`
* :ref:`RETURN`
* :ref:`REV`
* :ref:`ROSTER`
* :ref:`ROTATE`
* :ref:`ROTATE_DCC`
* :ref:`ROUTE`
* :ref:`ROUTE_ACTIVE`
* :ref:`ROUTE_CAPTION`
* :ref:`ROUTE_DISABLED`
* :ref:`ROUTE_HIDDEN`
* :ref:`ROUTE_INACTIVE`
* :ref:`SCREEN`
* :ref:`SENDLOCO`
* :ref:`SEQUENCE`
* :ref:`SERIAL`
* :ref:`SERIAL1`
* :ref:`SERIAL2`
* :ref:`SERIAL3`
* :ref:`SERIAL4`
* :ref:`SERIAL5`
* :ref:`SERIAL6`
* :ref:`SERVO`
* :ref:`SERVO2`
* :ref:`SERVO_SIGNAL`
* :ref:`SERVO_TURNOUT`
* :ref:`SET`
* :ref:`SETFREQ`
* :ref:`SETLOCO`
* :ref:`SET_POWER`
* :ref:`SET_TRACK`
* :ref:`SIGNAL`
* :ref:`SIGNALH`
* :ref:`SPEED`
* :ref:`START`
* :ref:`STASH`
* :ref:`STEALTH`
* :ref:`STEALTH_GLOBAL`
* :ref:`STOP`
* :ref:`THROW`
* :ref:`TOGGLE_TURNOUT`
* :ref:`TT_ADDPOSITION`
* :ref:`TURNOUT`
* :ref:`TURNOUTL`
* :ref:`UNJOIN`
* :ref:`UNLATCH`
* :ref:`VIRTUAL_SIGNAL`
* :ref:`VIRTUAL_TURNOUT`
* :ref:`WAITFOR`
* :ref:`WAITFORTT`
* :ref:`EXRAIL_WITHROTTLE`
* :ref:`XFOFF`
* :ref:`XFON`
* :ref:`XFTOGGLE`

``AUTOSTART`` - Automatically start sequence at this point during EX-CommandStation startup

A sequence is automatically started at this point during startup.

If you have previously relied on the implied AUTOSTART to run things immediately,  as of Version 5.0 you must now add this explicitly to the beginning of myAutomation.h

autostart - automatically start sequence at this point during ex-commandstation startup

``AUTOMATION( id, "description" )`` - Define an automation, advertised to throttles/clients

Define an automation sequence that is advertised to throttles/clients to send a train along.

See :ref:`exrail/examples:Stopping at a Station (simple loop)` for a simple example.

|_| > **id** - id for the sequence/route/automation |BR|
|_| > **description** - description for the sequence/route/automation

automation( id, "description" ) - define an automation, advertised to throttles/clients

``ROUTE( id, "description" )`` - Define a route, advertised to throttles/clients

Define a route that is advertised to throttles/clients. This can be used to initiate automation sequences such as setting turnouts/points and signals to allow a train to be driven through a specific route on the layout. See :ref:`exrail/examples:creating routes` for various examples.

Define a route that is advertised to throttles/clients. This can be used to initiate automation sequences such as setting turnouts/points and signals to allow a train to be driven through a specific route on the layout. See 

route( id, "description" ) - define a route, advertised to throttles/clients

``SEQUENCE( id )`` - A general purpose sequence, not advertised to throttles/clients

A general purpose automation sequence that is not advertised to throttles/clients. This may be triggered automatically on startup, or be called by other sequences or activities. See :ref:`exrail/examples:automating various non-track items`, :ref:`exrail/examples:Point to Point Shuttle`, and :ref:`exrail/examples:multiple inter-connected trains` for further examples.

A general purpose automation sequence that is not advertised to throttles/clients. This may be triggered automatically on startup, or be called by other sequences or activities. See 

All of these sequence types must be terminated by either a ``DONE``, ``FOLLOW(id)``, or ``RETURN`` statement. If you use ``FOLLOW(id)`` or ``RETURN``, you do not also need a ``DONE`` statement as any of these terms will tell |EX-R| that the sequence of events has ended.

sequence( id ) - a general purpose sequence, not advertised to throttles/clients

``DONE`` - Completes a Sequence/Route/Animation/Event, or any other automation

Completes a Sequence/Route/Animation/Event handler, and any other automation definition as shown in the various examples on this page and elsewhere in the |EX-R| documentation.

Completes a Sequence/Route/Animation/Event handler, and any other automation definition as shown in the various examples on this page and elsewhere in the 

done - completes a sequence/route/animation/event, or any other automation

``ENDTASK`` - Completes a Sequence/Route/Animation/Event, or any other automation

endtask - completes a sequence/route/animation/event, or any other automation

Branch to a separate sequence, which will need to RETURN when complete.

|_| > **id** - id for the sequence/route/automation to branch to

Return to the calling sequence when completed (no DONE required).

For example, you have an AUTOMATION which you initiate that sends a train through your layout with multiple station stops, and you want to do the same things at each station.

You could write a very long AUTOMATION sequence to do this, or you could write the sound SEQUENCE once, then call it at each station:

  AUTOMATION(21, "Station loop")    // Our station loop sequence
    FWD(30)
    AT(101)                         // At station 1 entrance sensor, call our "Station sequence"
    CALL(22)
    AT(102)                         // At station 2 entrance sensor, call our "Station sequence"
    CALL(22)
    AT(103)                         // At station 3 entrance sensor, call our "Station sequence"
    CALL(22)
    AT(104)                         // At station 4 entrance sensor, call our "Station sequence"
    CALL(22)
    FOLLOW(21)                      // Keep looping through the "Station loop" automation (see FOLLOW command reference below)

  SEQUENCE(22, "Station sequence")  // Our station sequence
    FON(2)                         // Blow the horn
    FON(3)                         // Break squeal
    STOP                            // Stop at the station
    FON(4)                         // Let out a hiss from the air breaks for a second
    DELAY(1000)
    FOFF(4)
    DELAYRANDOM(2000, 10000)        // Wait between 2 and 10 seconds for passengers
    FON(2)                         // Blow the horn again
    FWD(30)                         // On our way to the next station
    RETURN                          // Return to the calling sequence

AUTOMATION(21, "Station loop")    // Our station loop sequence
  FWD(30)
  AT(101)                         // At station 1 entrance sensor, call our "Station sequence"
  CALL(22)
  AT(102)                         // At station 2 entrance sensor, call our "Station sequence"
  CALL(22)
  AT(103)                         // At station 3 entrance sensor, call our "Station sequence"
  CALL(22)
  AT(104)                         // At station 4 entrance sensor, call our "Station sequence"
  CALL(22)
  FOLLOW(21)                      // Keep looping through the "Station loop" automation (see FOLLOW command reference below)

SEQUENCE(22, "Station sequence")  // Our station sequence
  FON(2)                         // Blow the horn
  FON(3)                         // Break squeal
  STOP                            // Stop at the station
  FON(4)                         // Let out a hiss from the air breaks for a second
  DELAY(1000)
  FOFF(4)
  DELAYRANDOM(2000, 10000)        // Wait between 2 and 10 seconds for passengers
  FON(2)                         // Blow the horn again
  FWD(30)                         // On our way to the next station
  RETURN                          // Return to the calling sequence

``FOLLOW( sequence_id )`` - Branch or Follow a specified sequence

Branch or Follow a specified sequence. This lets us do clever things like performing a different sequence depending on whether a turnout/point is CLOSED or THROWN, as well as simple things such as the example above where we keep looping through the same sequence.

|_| > **sequence_id** - id for the sequence/route/automation to branch to

  AUTOMATION(23, "Choose your own adventure") // This let's someone control the sequence by throwing a turnout/point (or not)
    FWD(30)
    AFTER(105)
    IFTHROWN(106)
      FOLLOW(24)
    ELSE
      FOLLOW(25)
    ENDIF
    DONE

  SEQUENCE(24, "Adventure 1")                 // Quite a boring adventure to stop in a siding after sensor 106 has activated/deactivated
    AFTER(106)
    FON(2)
    FON(3)
    STOP
    DONE

  SEQUENCE(25, "Adventure 2")                 // If we don't throw the turnout/point, let's do our station loop from the example above
    FOLLOW(21)

AUTOMATION(23, "Choose your own adventure") // This let's someone control the sequence by throwing a turnout/point (or not)
  FWD(30)
  AFTER(105)
  IFTHROWN(106)
    FOLLOW(24)
  ELSE
    FOLLOW(25)
  ENDIF
  DONE

SEQUENCE(24, "Adventure 1")                 // Quite a boring adventure to stop in a siding after sensor 106 has activated/deactivated
  AFTER(106)
  FON(2)
  FON(3)
  STOP
  DONE

SEQUENCE(25, "Adventure 2")                 // If we don't throw the turnout/point, let's do our station loop from the example above
  FOLLOW(21)

E-STOP all locos and PAUSE all other |EX-R| tasks until RESUMEd.

``DELAY( delay )`` - Delay the sequence a number of milliseconds

|_| > **delay** - period to delay in milliseconds

``DELAYMS( delay )`` - Delay the sequence a number of milliseconds

``DELAYRANDOM( min_delay, max_delay )`` - Delay a random period of time

Delay the current sequence a random time between min and max milliseconds.

See :ref:`exrail/examples:Multiple inter-connected trains` for good examples.

|_| > **min_delay** - minimum period to delay in milliseconds |BR|
|_| > **max_delay** - maximum period to delay in milliseconds

  ONCLOSE(102)      // When turnout 102 closed, wait 2 seconds, then set signal 101 green.
    DELAY(2000)
    GREEN(101)
    DONE

  AT(123)           // When sensor 123 is activated, set signal 102 red, wait 1 minute, then set signal 102 green.
    RED(102)
    DELAYMINS(1)
    GREEN(102)
    DONE

ONCLOSE(102)      // When turnout 102 closed, wait 2 seconds, then set signal 101 green.
  GREEN(101)
  DONE

AT(123)           // When sensor 123 is activated, set signal 102 red, wait 1 minute, then set signal 102 green.
  RED(102)
  DELAYMINS(1)
  GREEN(102)
  DONE

delayrandom( min_delay, max_delay ) - delay a random period of time

``IFRANDOM( percent )`` - Run commands a random percentage of the time

Runs commands in IF block a random percentage of the time. This is handy for more realism by enabling automations that don't have to run on a schedule.

Runs commands in IF block a random percentage of the time. This is handy for more realism by enabling automations that don’t have to run on a schedule.

|_| > **percent** - percentage to test against (0-100) |BR|

  AT(165)           // When sensor 165 is activated, set a lineside merry-go-round in action for 1 minute 50% of the time.
    IFRANDOM(50)
      SET(166)
      DELAYMINS(1)
      RESET(166)
    ENDIF
    DONE

AT(165)           // When sensor 165 is activated, set a lineside merry-go-round in action for 1 minute 50% of the time.
  IFRANDOM(50)
    SET(166)
    RESET(166)
  ENDIF
  DONE

ifrandom( percent ) - run commands a random percentage of the time

``ROUTE_CAPTION( route_id, "caption" )`` - Change the label of the Route button

|_| > **route_id** - id of the route to change |BR|
|_| > **caption** - text to replace on the route 'button' label

  // setup 4 'routes' to switch between tracks/districts between PROG, MAIN and DC
  ROUTE(500,"1.Trk: A main, B prog")
      SET_TRACK(A,MAIN)
      SET_TRACK(B,PROG)
      ROUTE_CAPTION(500,"Active")
      ROUTE_CAPTION(501,"Inactive")
      ROUTE_CAPTION(502,"Inactive")
      ROUTE_CAPTION(503,"Inactive")
      ROUTE_ACTIVE(500)
      ROUTE_INACTIVE(501)
      ROUTE_INACTIVE(502)
      ROUTE_INACTIVE(503)
  DONE
  ROUTE(501,"2.Trk: A dc10, B dc11")
      SETLOCO(10) SET_TRACK(A,DC)
      SETLOCO(11) SET_TRACK(B,DC)
      ROUTE_CAPTION(500,"Inactive")
      ROUTE_CAPTION(501,"Active")
      ROUTE_INACTIVE(500)
      ROUTE_ACTIVE(501)
  DONE
  ROUTE(502,"3.Trk: A dc10, B DCC main")
      SETLOCO(11) SET_TRACK(B,MAIN)
      ROUTE_CAPTION(502,"Active")
      ROUTE_ACTIVE(502)
  DONE
  ROUTE(503,"4.Trk: A DCC main, B dc10")
      ROUTE_CAPTION(503,"Active")
      ROUTE_ACTIVE(503)
  DONE

// setup 4 'routes' to switch between tracks/districts between PROG, MAIN and DC
ROUTE(500,"1.Trk: A main, B prog")
    SET_TRACK(A,MAIN)
    SET_TRACK(B,PROG)
    ROUTE_CAPTION(500,"Active")
    ROUTE_CAPTION(501,"Inactive")
    ROUTE_CAPTION(502,"Inactive")
    ROUTE_CAPTION(503,"Inactive")
    ROUTE_ACTIVE(500)
    ROUTE_INACTIVE(501)
    ROUTE_INACTIVE(502)
    ROUTE_INACTIVE(503)
DONE
ROUTE(501,"2.Trk: A dc10, B dc11")
    SETLOCO(10) SET_TRACK(A,DC)
    SETLOCO(11) SET_TRACK(B,DC)
    ROUTE_CAPTION(500,"Inactive")
    ROUTE_CAPTION(501,"Active")
    ROUTE_INACTIVE(500)
    ROUTE_ACTIVE(501)
DONE
ROUTE(502,"3.Trk: A dc10, B DCC main")
    SETLOCO(11) SET_TRACK(B,MAIN)
    ROUTE_CAPTION(502,"Active")
    ROUTE_ACTIVE(502)
DONE
ROUTE(503,"4.Trk: A DCC main, B dc10")
    ROUTE_CAPTION(503,"Active")
    ROUTE_ACTIVE(503)
DONE

route_caption( route_id, "caption" ) - change the label of the route button

|_| > **route_id** - id of the route to activate |BR|

|_| > **route_id** - id of the route to deactivate |BR|

|_| > **route_id** - id of the route to hide |BR|

|_| > **route_id** - id of the route to disable |BR|

|_| > **stash_id** - id of the stash location to store the value (0-???) |BR|

Stashes/Stores the current loco/invert in the specified stash location.

|EX-R| has the ability to switch the DCC direction meaning of FWD and REV so that it can, for example, use the same sequence to drive a normal train or one where the loco is pulling in reverse. If invert=1 in the stash then the loco needs to be moved in reverse in order for the train to move forward.

 has the ability to switch the DCC direction meaning of FWD and REV so that it can, for example, use the same sequence to drive a normal train or one where the loco is pulling in reverse. If invert=1 in the stash then the loco needs to be moved in reverse in order for the train to move forward.

``PICKUP_STASH( stash_id )`` - Retrieves and sets the loco/invert from the specified stash

Retrieves and sets the loco/invert from the specified stash location.

pickup_stash( stash_id ) - retrieves and sets the loco/invert from the specified stash

There are numerous conditional statements available to influence activities based on the states of sensors, signals, turnouts/points, and other items.

Any directive on this page starting with ``IF`` must have an associated ``ENDIF`` statement, and optionally an ``ELSE`` statement if an alternative activity is to be performed.

If a conditional statement is part of an automation sequence, the sequence still needs to be terminated with a ``DONE``, ``FOLLOW()``, or ``RETURN`` statement.

If a conditional statement is part of an automation sequence, the sequence still needs to be terminated with a 

This include ``IFNOT()``, ``IFRED()``, ``IFAMBER()``, ``IFGREEN()``,

Refer also to :ref:`exrail/exrail-command-reference:correct use of done, endif, and follow() statements`.

:ref:`exrail/exrail-command-reference:correct use of done, endif, and follow() statements`

``IF ( vpin )`` ... ELSE ... ENDIF  - Execute commands if the conditions are met

Perform the following block of commands if the specified sensor is active.

Optionally be followed by an ``ELSE`` somewhere in the following commands.
Must be followed by an ``ENDIF`` somewhere in the following commands.

|_| > **vpin** - vpin (or alias) of the sensor to check |BR|

Also see ``IFNOT()``, ``IFRED()``, ``IFAMBER()``, ``IFGREEN()``, ``IFCLOSED()``, ``IFTHROWN()``, ``IFRANDOM()``, ``IFTTPOSITION()``, ``IFRE()``, ``IFTIMEOUT()``, ``IFGTE()``, ``IFLT()``, ``IFLOCO()``, ``IFRESERVE()``

if ( vpin ) ... else ... endif - execute commands if the conditions are met

``IFNOT ( vpin )`` ... ELSE ... ENDIF  - Execute commands if the conditions are NOT met

Perform the following block of commands if the specified sensor is not active.

ifnot ( vpin ) ... else ... endif - execute commands if the conditions are not met

``ELSE`` - Alternate logic to any IF related command returning False

Provides alternative logic to any IF related command returning False.

Must be proceeded by an ``IF()`` somewhere in the preceding commands.

else - alternate logic to any if related command returning false

Optionally be proceeded by an ``ELSE`` somewhere in the preceding commands.

Halt the execution of the current block of commands until the sensor is set.

|_| > **vpin** - pin/vpin of the sensor to check |BR|

``AFTER( vpin [,debounce_time] )`` - Halt command execution until the sensor is cleared

Halt the execution of the current block of commands until the sensor is cleared.

|_| > **debounce_time** -  optional debounce time (default 500mS) |BR|

after( vpin [,debounce_time] ) - halt command execution until the sensor is cleared

``HAL( device, parameters )`` - Create a HAL device in myAutomation.h

Create a HAL device in myAutomation.h rather than needing to use myHal.cpp

|_| > **device** - device |BR|
|_| > **parameters** -  as needed |BR|

  // Define a third PCA9685 device following the first two default devices at Vpin 132 and I2C address 0x42
  HAL(PCA9685, 132, 16, 0x42)

  // Define a third MCP23017 device following the first two default devices at Vpin 196 and I2C address 0x22
  HAL(MCP23017, 196, 16, 0x22)

  // Define a Mega2560 based EX-IOExpander device starting at Vpin 800 at the default I2C address of 0x65
  HAL(EXIOExpander, 800, 62, 0x65)

  // Define an EX-Turntable device at the default Vpin 600 and I2C address of 0x60
  HAL(EXTurntable, 600, 1, 0x60)

// Define a third PCA9685 device following the first two default devices at Vpin 132 and I2C address 0x42
HAL(PCA9685, 132, 16, 0x42)

// Define a third MCP23017 device following the first two default devices at Vpin 196 and I2C address 0x22
HAL(MCP23017, 196, 16, 0x22)

// Define a Mega2560 based EX-IOExpander device starting at Vpin 800 at the default I2C address of 0x65
HAL(EXIOExpander, 800, 62, 0x65)

// Define an EX-Turntable device at the default Vpin 600 and I2C address of 0x60
HAL(EXTurntable, 600, 1, 0x60)

hal( device, parameters ) - create a hal device in myautomation.h

``HAL_IGNORE_DEFAULTS`` - Disable default MCP23017 and PCA9685 HAL devices

hal_ignore_defaults - disable default mcp23017 and pca9685 hal devices

``SIGNAL( red_pin, amber_pin, green_pin )`` - Define a pin based signal

Define a pin based signal, which requires three active low pins to be defined to correspond with red, amber, and green lights. Active low means they are activated when the associated pins are set to 0V or ground.

|_| > **red_pin** - pin/vpin of the red LED. Also defines the signal_id. |BR|
|_| > **amber_pin** - pin/vpin of the amber LED |BR|
|_| > **green_pin** - pin/vpin of the green LED |BR|

signal( red_pin, amber_pin, green_pin ) - define a pin based signal

``SIGNALH( red_pin, amber_pin, green_pin )`` - Define a pin based signal with active high pins

As above to define a pin based signal, but with active high pins instead. Active high means they are activated when the associated pins are set to 5V (or 3.3V if using a 3.3V device).

For both the SIGNAL/SIGNALH commands, signal colour is set using the pin defined for the red pin. If the signal only has two colours (e.g. RED/GREEN), set the unused colour's pin to 0.

For both the SIGNAL/SIGNALH commands, signal colour is set using the pin defined for the red pin. If the signal only has two colours (e.g. RED/GREEN), set the unused colour’s pin to 0.

signalh( red_pin, amber_pin, green_pin ) - define a pin based signal with active high pins

``SERVO_SIGNAL( vpin, red_pos, amber_pos, green_pos )`` - Define a servo based signal

Define a servo based signal, such as semaphore signals. Each position is an angle to turn the servo to, similar to the SERVO/SERVO2 commands, and SERVO_TURNOUT

|_| > **vpin** - pin/vpin of the servo |BR|
|_| > **red_pos** - position to move the servo to for a red signal |BR|
|_| > **amber_pos** - position to move the servo to for a amber signal |BR|
|_| > **green_pos** - position to move the servo to for a green signal |BR|

servo_signal( vpin, red_pos, amber_pos, green_pos ) - define a servo based signal

``DCC_SIGNAL( id, addr, sub_addr )`` - Define a DCC accessory signal

Define a DCC accessory signal. Control the colour or aspect of these via the defined ``id``

Define a DCC accessory signal. Control the colour or aspect of these via the defined 

dcc_signal( id, addr, sub_addr ) - define a dcc accessory signal

``DCCX_SIGNAL( Address, redAspect, amberAspect, greenAspect )`` - Defines a signal (with id as dcc address)

This defines a signal (with id same as dcc address) that can be operated
by the RED/AMBER/GREEN commands.   In each case the command uses the signal address to refer to the signal and the aspect chosen depends on the use of the RED AMBER or GREEN command sent. Other aspects may be sent but will require the direct use of the ASPECT command.

The IFRED/IFAMBER/IFGREEN  and ONRED/ONAMBER/ONGREEN commands continue to operate as for any other signal type. It is important to be aware that use of the ASPECT (see below) or <A> commands will correctly set the IF flags and call the ON handlers if ASPECT is used to set one of the three aspects defined in the DCCX_SIGNAL command.

Direct use of other aspects does not affect the signal flags. ASPECT and <A> can be used without defining any signal if the flag management or ON event handlers are not required.

dccx_signal( address, redaspect, amberaspect, greenaspect ) - defines a signal (with id as dcc address)

Define a virtual signal, which is backed by another automation sequence

|_| > **signal_id** - id of the virtual signal to test |BR|

|_| > **signal_id** - id of the virtual signal to set |BR|

|_| > **signal_id** - id of the virtual signal to set|BR|

``ASPECT( address, aspect )`` - Command for DCC Extended Accessories

This command sends an extended accessory packet to the track, normally used to set
a signal aspect. Aspect numbers are undefined as standards except for 0 which is
always considered a stop.  The exact aspect codes to be used must be determined from the documentation for the accessory decoder in use.

aspect( address, aspect ) - command for dcc extended accessories

``ONGREEN( signal_id)`` - Define event handler for when a signal is set to the green

Define an event handler for when a signal is set to the green aspect.

ongreen( signal_id) - define event handler for when a signal is set to the green

``ONAMBER( signal_id)`` - Define event handler for when a signal is set to the amber

Define an event handler for when a signal is set to the amber aspect.

onamber( signal_id) - define event handler for when a signal is set to the amber

``ONRED( signal_id)`` - Define event handler for when a signal is set to the red aspect

Define an event handler for when a signal is set to the red aspect.

|_| > **signal_id** - id (or alias) of the virtual signal to set |BR|

  SIGNAL(25, 26, 27)                // Active low red/amber/green signal using pins 25/26/27 directly on the EX-CommandStation.
  SIGNALH(164 ,0, 165)              // Active high red/green signal using the first two pins of an MCP23017 I/O expander module.
  SERVO_SIGNAL(101, 100, 250, 400)  // Servo based signal using the first PCA9685 servo module.

  GREEN(25)                         // Sets our active low signal to green.
  GREEN(164)                         // Sets our active high signal to green.
  GREEN(101)                        // Sets our servo based signal to green.

SIGNAL(25, 26, 27)                // Active low red/amber/green signal using pins 25/26/27 directly on the EX-CommandStation.
SIGNALH(164 ,0, 165)              // Active high red/green signal using the first two pins of an MCP23017 I/O expander module.
SERVO_SIGNAL(101, 100, 250, 400)  // Servo based signal using the first PCA9685 servo module.

GREEN(25)                         // Sets our active low signal to green.
GREEN(164)                         // Sets our active high signal to green.
GREEN(101)                        // Sets our servo based signal to green.

onred( signal_id) - define event handler for when a signal is set to the red aspect

All the below turnout/point definitions will define turnouts/points that are advertised to |WiThrottle Protocol| apps, |Engine Driver|, and |JMRI|, unless the HIDDEN keyword is used.

All the below turnout/point definitions will define turnouts/points that are advertised to 

"description" is an optional parameter, and must be enclosed in quotes "". If you don't wish this turnout/point to be advertised to throttles, then substitute the word HIDDEN (with no "") instead of the description.

“description” is an optional parameter, and must be enclosed in quotes “”. If you don’t wish this turnout/point to be advertised to throttles, then substitute the word HIDDEN (with no “”) instead of the description.

``TURNOUT( turnout_id, addr, sub_addr [, "description"]|HIDDEN )`` - Define a DCC accessory turnout/point

Define a DCC accessory turnout/point. Note that DCC linear addresses are not supported, and must be converted to address/subaddress in order to be defined. Refer to the :ref:`reference/downloads/documents:stationary decoder address table (xlsx spreadsheet)` for help on these conversions. (or see TURNOUTL below).

Define a DCC accessory turnout/point. Note that DCC linear addresses are not supported, and must be converted to address/subaddress in order to be defined. Refer to the 

:ref:`reference/downloads/documents:stationary decoder address table (xlsx spreadsheet)`

|_| > **turnout_id** - identifier of the Turnout/Point |BR|
|_| > **addr** - ranges from 0 to 511 |BR|
|_| > **subaddr** - ranges from 0 to 3 |BR|
|_| > **description** - The description that will be assigned to the turnout/point, or |BR|
|_| > *HIDDEN* - keyword - if used instead of the "description" the Turnout/point will not appear in the lists sent to throttle/controllers |BR|

 - The description that will be assigned to the turnout/point, or 

 - keyword - if used instead of the “description” the Turnout/point will not appear in the lists sent to throttle/controllers 

turnout( turnout_id, addr, sub_addr [, "description"]|hidden ) - define a dcc accessory turnout/point

``TURNOUTL( turnout_id, addr [, "description"]|HIDDEN )`` - Define a DCC accessory turnout/point

Define a DCC accessory turnout/point.  This command will convert a linear address to the address/subaddress format using the TURNOUT command above.

Note when providing the name of the profile the profile names are case sensitive, and must be written exactly as they appear (e.g. Bounce, not bounce or BOUNCE).

turnoutl( turnout_id, addr [, "description"]|hidden ) - define a dcc accessory turnout/point

``PIN_TURNOUT( turnout_id, pin [, "description"]|HIDDEN )`` - Define a pin operated turnout

Define a pin operated turnout. When sending a CLOSE command, the pin will be HIGH, and a THROW command will set the pin LOW.

|_| > **turnout_id** - unique Id for the turnout/point servo |BR|
|_| > **pin** - pin/vpin to which the servo is attached |BR|

pin_turnout( turnout_id, pin [, "description"]|hidden ) - define a pin operated turnout

``SERVO_TURNOUT( turnout_id, pin, active_angle, inactive_angle, profile [, "description"]|HIDDEN )`` - Define a servo turnout/point

Define a servo turnout/point. "active_angle" is for THROW, "inactive_angle" is for CLOSE, and profile is one of Instant, Fast, Medium, Slow or Bounce (although clearly we don't recommend Bounce for turnouts/points!).

Define a servo turnout/point. “active_angle” is for THROW, “inactive_angle” is for CLOSE, and profile is one of Instant, Fast, Medium, Slow or Bounce (although clearly we don’t recommend Bounce for turnouts/points!).

|_| > **pin** - vpin to which the servo is attached |BR|
|_| > **active_angle** - the PWM value corresponding to the servo position for THROWN state, normally in the range 102 to 490 |BR|
|_| > **inactive_angle** - the PWM value corresponding to the servo position for CLOSED state, normally in the range 102 to 490 |BR|
|_| > **profile** - one of |BR|
|_| |_| |_| |_| • **0** = Instant,  |BR|
|_| |_| |_| |_| • **1** = Fast (0.5 sec),  |BR|
|_| |_| |_| |_| • **2** = Medium (1 sec),  |BR|
|_| |_| |_| |_| • **3** = Slow (2 sec) and  |BR|
|_| |_| |_| |_| • **4** = Bounce (subject to revision) |BR|

 - the PWM value corresponding to the servo position for THROWN state, normally in the range 102 to 490 

 - the PWM value corresponding to the servo position for CLOSED state, normally in the range 102 to 490 

Refer to :doc:`/reference/hardware/servo-module` for more information.

servo_turnout( turnout_id, pin, active_angle, inactive_angle, profile [, "description"]|hidden ) - define a servo turnout/point

``VIRTUAL_TURNOUT( turnout_id [, "description"]|HIDDEN )`` - Define a virtual turnout, which is backed by another automation sequence

Define a virtual turnout, which is backed by another automation sequence.

For a good example of this refer to :ref:`exrail/tips:realistic turnout sequences`.

|_| > **turnout_id** - The id of the turnout/point |BR|

  TURNOUT(100, 26, 0, "Coal Yard")                  // DCC accessory turnout at linear address 101.
  PIN_TURNOUT(101, 164, "Switching Yard")           // Pin turnout on an MCP23017 I/O expander module.
  SERVO_TURNOUT(102, 102, 400, 100, Slow, HIDDEN)   // A servo turnout on a PCA9685 servo module that is hidden from throttles.
  VIRTUAL_TURNOUT(103, "Lumber Yard")               // A virtual turnout which will trigger an automation sequence when CLOSE or THROW is sent.

TURNOUT(100, 26, 0, "Coal Yard")                  // DCC accessory turnout at linear address 101.
PIN_TURNOUT(101, 164, "Switching Yard")           // Pin turnout on an MCP23017 I/O expander module.
SERVO_TURNOUT(102, 102, 400, 100, Slow, HIDDEN)   // A servo turnout on a PCA9685 servo module that is hidden from throttles.
VIRTUAL_TURNOUT(103, "Lumber Yard")               // A virtual turnout which will trigger an automation sequence when CLOSE or THROW is sent.

virtual_turnout( turnout_id [, "description"]|hidden ) - define a virtual turnout, which is backed by another automation sequence

|_| > **turnout_id** - The id of the turnout/point to test |BR|

``ONCLOSE( turnout_id )`` - Event handler for when a turnout/point is closed

Event handler for when a turnout/point is sent a close command. Note that there can be only one defined ONCLOSE event for a specific turnout/point.

onclose( turnout_id ) - event handler for when a turnout/point is closed

``ONTHROW( turnout_id )`` - Event handler for when a turnout/point is thrown

Event handler for when a turnout/point is sent a throw command. Note that there can be only one defined ONTHROW event for a specific turnout/point.

onthrow( turnout_id ) - event handler for when a turnout/point is thrown

|_| > **turnout_id** - The id of the turnout/point to close |BR|

|_| > **turnout_id** - The id of the turnout/point to throw |BR|

``TOGGLE_TURNOUT( turnout_id )`` - Toggle a defined turnout/point between CLOSE/THROW

Toggles the state of the specified turnout/point between closed and thrown.

toggle_turnout( turnout_id ) - toggle a defined turnout/point between close/throw

Also refer to :ref:`ex-turntable/test-and-tune:exrail definition and control`.

``MOVETT( id, steps, activity )`` - Move a |EX-TT| to a step position and perform an activity

Move the specified |EX-TT| to the provided step position and perform the specified activity.

 to the provided step position and perform the specified activity.

|_| > **id** - The id of the turntable |BR|
|_| > **steps** - The step position to move to |BR|
|_| > **activity** - The activity to perform |BR|

From version 5.4.0, we highly recommend using our new turntable/traverser commands which allow turntables/traversers to be advertised to throttles similarly to how turnout/point objects are advertised and operated. Refer to :ref:`exrail/exrail-command-reference:turntable features`.

From version 5.4.0, we highly recommend using our new turntable/traverser commands which allow turntables/traversers to be advertised to throttles similarly to how turnout/point objects are advertised and operated. Refer to 

movett( id, steps, activity ) - move a ex-tt to a step position and perform an activity

``IFRE ( vpin, value )`` - Test if a rotary encoder has been set to a value

|_| > **vpin** - The VPin the encoder is connected to |BR|
|_| > **value** - value to test |BR|

ifre ( vpin, value ) - test if a rotary encoder has been set to a value

``ONCHANGE( vpin )`` - Detects a rotary encoder has changed position

  ONCHANGE(700)     // If rotary encoder ID 700 change state do this sequence
    IFRE(700, 1)    // If rotary encoder ID 700 is at position 1, start ROUTE ID 123
      START(123)
    ENDIF
    IFRE(700, 2)    // If rotary encoder ID 700 is at position 2, start ROUTE ID 124
      START(124)
    ENDIF
    DONE

ONCHANGE(700)     // If rotary encoder ID 700 change state do this sequence
  IFRE(700, 1)    // If rotary encoder ID 700 is at position 1, start ROUTE ID 123
    START(123)
  ENDIF
  IFRE(700, 2)    // If rotary encoder ID 700 is at position 2, start ROUTE ID 124
    START(124)
  ENDIF
  DONE

onchange( vpin ) - detects a rotary encoder has changed position

All the below turntable/traverser definitions will define turntables/traversers that are advertised to throttles that understand them, unless the HIDDEN keyword is used.

To fully define a turntable/traverser object, you need to define the object first, and then one or more positions.

"description" is an optional parameter, and must be enclosed in quotes "". If you don't wish this turntable/traverser to be advertised to throttles, then substitute the word HIDDEN (with no "") instead of the description.

“description” is an optional parameter, and must be enclosed in quotes “”. If you don’t wish this turntable/traverser to be advertised to throttles, then substitute the word HIDDEN (with no “”) instead of the description.

``DCC_TURNTABLE( id, home_angle, [, "description"] )`` - Define a DCC accessory turntable/traverser

Define a DCC accessory turntable/traverser at the specified **id** and the **home_angle** angle.

|_| > **id** - id of the turntable/traverser, valid IDs are 1 - 32767 |BR|
|_| > **home_angle** - the angle of the home position, valid angles are 0 - 3600

dcc_turntable( id, home_angle, [, "description"] ) - define a dcc accessory turntable/traverser

``EXTT_TURNTABLE( id, vpin, home_angle, [, "description"] )`` - Define an EX-Turntable turntable/traverser

Define an EX-Turntable turntable/traverser at the specified **id** and **vpin** with a **home_angle** angle.

This statement will create the |EX-TT| turntable/traverser object only, so you will need a separate ``HAL()`` statement for an |EX-TT| device to create the HAL device. It is not recommended to create it via "myHal.cpp".

 device to create the HAL device. It is not recommended to create it via “myHal.cpp”.

The HAL creation will require the **vpin** and **i2c_address** parameters.

|_| > **vpin** - id of the vpin where the |EX-TT| device is located |BR|
|_| > **i2c_address** - the |I2C| address of the |EX-TT| device |BR|

HAL(EXTurntable,600,1,0x60)            // Create your EX-Turntable device driver
EXTT_TURNTABLE(1,600,45,"My EX-Turntable")  // Create your EX-Turntable object to enable control

extt_turntable( id, vpin, home_angle, [, "description"] ) - define an ex-turntable turntable/traverser

``TT_ADDPOSITION( id, position_id, value, angle [, "description"] )`` - Add a turntable position

Add a position to a turntable/traverser object **turntable_id** with position index **position_id**, step or DCC address **value**, **angle** degrees from home.

|_| > **id** - id of the turntable/traverser, which must be created prior to adding positions |BR|
|_| > **position_id** - index of the position to add, valid positions are (1 - 48) |BR|
|_| > **value** - either steps from home for EX-Turntable, or the linear DCC address for a DCC accessory turntable, valid values are (1 - 32767) |BR|
|_| > **angle** - angle of the position from the home position, valid angles are (0 - 3600)

 - id of the turntable/traverser, which must be created prior to adding positions 

 - either steps from home for EX-Turntable, or the linear DCC address for a DCC accessory turntable, valid values are (1 - 32767) 

 - angle of the position from the home position, valid angles are (0 - 3600)

tt_addposition( id, position_id, value, angle [, "description"] ) - add a turntable position

``IFTTPOSITION( id, position )`` - Test if turntable/traverser is at a position

Tests if the turntable/traverser at the specified **id** is at the specified **position**.

|_| > **id** - id of the turntable/traverser to test. (1 - 32767) |BR|
|_| > **position** - position to rotate to. (1 - 48)

ifttposition( id, position ) - test if turntable/traverser is at a position

``ONROTATE( id )`` - Event handler for when a turntable/traverser is rotated

Triggers the event handling mechanism for turntable/traverser **id** if configured. Note that there can be only one defined ONROTATE event for a specific turntable/traverser.

 if configured. Note that there can be only one defined ONROTATE event for a specific turntable/traverser.

|_| > **id** - id of the turntable/traverser to test (1 - 32767)

onrotate( id ) - event handler for when a turntable/traverser is rotated

``ROTATE( id, position, activity )`` - Rotate an EX-Turntable turntable/traverser

Rotate an EX-Turntable turntable/traverser at the specified **id** to the specified **position**, and perform **activity**.

|_| > **id** - id of the turntable/traverser, valid IDs are (1 - 32767) |BR|
|_| > **position** - position to rotate to, valid positions are (1 - 48) |BR|
|_| > **activity** - refer to :ref:`ex-turntable/test-and-tune:ex-turntable activity reference`, using the "EXRAIL activity" column

:ref:`ex-turntable/test-and-tune:ex-turntable activity reference`

rotate( id, position, activity ) - rotate an ex-turntable turntable/traverser

``ROTATE_DCC( id, position )`` - Rotate a DCC accessory turntable/traverser

Rotate a DCC accessory turntable/traverser at the specified **id** to the specified **position**.

|_| > **position** - position to rotate to, valid positions are (1 - 48)

rotate_dcc( id, position ) - rotate a dcc accessory turntable/traverser

``WAITFORTT( id )`` - Wait for EX-Turntable turntable/traverser to complete a rotation

Wait for the EX-Turntable turntable/traverser at **id** to complete a rotation. As no feedback can be received from DCC accessory turntables, this is only valid for EX-Turntable.

 to complete a rotation. As no feedback can be received from DCC accessory turntables, this is only valid for EX-Turntable.

waitfortt( id ) - wait for ex-turntable turntable/traverser to complete a rotation

``JMRI_SENSOR(vpin [,count])`` - Creates <S> type sensors visible to JMRI

This command causes the creation of |JMRI| <S> type sensors in a way that is simpler than repeating lines of <S> commands in mySetup.h.

 <S> type sensors in a way that is simpler than repeating lines of <S> commands in mySetup.h.

JMRI_SENSOR(100,16) will create <S> type sensors for vpins 100-115.

|_| > **vpin** - vpin to create |BR|
|_| > **count** - optional. Number of sensors to create. Inclusive on vpin. Default is one (1)

 - optional. Number of sensors to create. Inclusive on vpin. Default is one (1)

jmri_sensor(vpin [,count]) - creates <s> type sensors visible to jmri

``AT( vpin )`` - Causes a sequence to wait until a sensor is active/triggered

|_| > **vpin** - pin/vpin of the sensor to test

at( vpin ) - causes a sequence to wait until a sensor is active/triggered

``AFTER( vpin )`` - Causes a sequence to wait until after a sensor has been triggered

A sequence will not progress until after a sensor has been triggered and then is off for 0.5 seconds.

after( vpin ) - causes a sequence to wait until after a sensor has been triggered

``ATTIMEOUT( vpin, timeout_ms )`` - Causes a sequence to wait until either a sensor is active/triggered, or if the timer runs out

A sequence will not progress until either a sensor is active/triggered, or if the timer runs out. It then continues and sets a testable "timed out" flag (see ``IFTIMEOUT``).

A sequence will not progress until either a sensor is active/triggered, or if the timer runs out. It then continues and sets a testable “timed out” flag (see 

|_| > **vpin** - pin/vpin of the sensor to test |BR|
|_| > **timeout_ms** - time/duration to wait for in milliseconds

attimeout( vpin, timeout_ms ) - causes a sequence to wait until either a sensor is active/triggered, or if the timer runs out

If sensor activated or latched, continue. Otherwise skip to ELSE or matching ENDIF.

See the :ref:`Conditional Statements section <exrail_conditional_statements>` for more information on IF ... ELSE ... ENDIF commands.

:ref:`Conditional Statements section <exrail_conditional_statements>`

``IFNOT( vpin )`` - If sensor NOT activated and NOT latched, continue

If sensor NOT activated and NOT latched, continue. Otherwise skip to ELSE or matching ENDIF.

ifnot( vpin ) - if sensor not activated and not latched, continue

``IFTIMEOUT`` - Tests if "timed out" flag has been set by an ATTIMEOUT() sensor reading attempt

Tests if "timed out" flag has been set by an ATTIMEOUT() sensor reading attempt.

Tests if “timed out” flag has been set by an ATTIMEOUT() sensor reading attempt.

Note that with the sensor commands `IF()`, `IFNOT()`, `IFTIMEOUT()`, `AT()`, `ATTIMEOUT()`, and `AFTER()`, you can use negative values to enable the use of active HIGH sensors.

, you can use negative values to enable the use of active HIGH sensors.

  AT(40)        // Wait for pin 40 to go low.
  AT(-40)       // Wait for pin 40 to go high.

AT(40)        // Wait for pin 40 to go low.
AT(-40)       // Wait for pin 40 to go high.

iftimeout - tests if "timed out" flag has been set by an attimeout() sensor reading attempt

``ATGTE( vpin, value )`` - Waits for an analog pin to reach a value

|_| > **vpin** - analogue pin of the sensor to test |BR|
|_| > **value** - value to test against

``ATLT ( vpin, value )`` - Waits for an analog pin to go below a value

atlt ( vpin, value ) - waits for an analog pin to go below a value

``IFGTE( vpin, value )`` - Test if analog pin reading is greater than or equal to value

Test if analog pin reading is greater than or equal to value (>=).

ifgte( vpin, value ) - test if analog pin reading is greater than or equal to value

``IFLT( vpin, value )`` - Test if analog pin reading is less than value

All the `IFGTE()`, `IFLT()`, `ATGTE()`and `ATLT()` commands read the analog value from an analog input pin (A0 - A5 on an Arduino Mega) or an analog input from an I/O expander module. Valid values are defined by the capability of the analog to digital converter in use.

 commands read the analog value from an analog input pin (A0 - A5 on an Arduino Mega) or an analog input from an I/O expander module. Valid values are defined by the capability of the analog to digital converter in use.

  IF(25)          // If sensor on the EX-CommandStation pin 25 is activated, set a signal red, wait 10 seconds, then close a turnout/point.
    RED(101)
    DELAY(10)
    CLOSE(200)
  ENDIF

  IFNOT(26)       // If sensor on the EX-CommandStation pin 26 is not activated, keep our pedestrian crossing light at 102 green, else set it red.
  ELSE
    RED(102)
  ENDIF

  IFGTE(A2, 512)  // If reading the analog input from a photoelectric light sensor exceeds 512, it's bright enough to turn the street lights off.
    RESET(164)
  ENDIF

  IFLT(A3, 10)   // If current sensing from an analog occupancy detector had dropped below the threshold, turn off our mimic panel light, otherwise turn it on.
    RESET(165)
  ELSE
    SET(165)
  ENDIF

IF(25)          // If sensor on the EX-CommandStation pin 25 is activated, set a signal red, wait 10 seconds, then close a turnout/point.
  RED(101)
  DELAY(10)
  CLOSE(200)
ENDIF

IFNOT(26)       // If sensor on the EX-CommandStation pin 26 is not activated, keep our pedestrian crossing light at 102 green, else set it red.
ELSE
  RED(102)
ENDIF

IFGTE(A2, 512)  // If reading the analog input from a photoelectric light sensor exceeds 512, it's bright enough to turn the street lights off.
ENDIF

IFLT(A3, 10)   // If current sensing from an analog occupancy detector had dropped below the threshold, turn off our mimic panel light, otherwise turn it on.
  RESET(165)
ELSE
  SET(165)
ENDIF

iflt( vpin, value ) - test if analog pin reading is less than value

|_| > **vpin** - analogue pin of the sensor to ???

|_| > **vpin** - pin/vpin of the sensor to latch

|_| > **vpin** - pin/vpin of the sensor to unlatch

In this example, LATCH/UNLATCH is used to toggle between two different activities each time the ROUTE is selected in a WiThrottle:

  TURNOUT(17, 30, 1, "Bay to Shed") // DCC turnout/point with linear address 117

  ALIAS(BayExitStarter, 107)        // Starter Signal with Route board
  ALIAS(ROUTE_TOGGLE, 11)           // State flag to toggle

  ROUTE(11, "Bay to Shed")
    IF(ROUTE_TOGGLE)             // If ROUTE_TOGGLE is active, reset the route
      DEACTIVATEL(BayExitStarter)
      DELAY(20)
      CLOSE(17)
      UNLATCH(ROUTE_TOGGLE)           // UNLATCH (Clear) ROUTE_TOGGLE
    ELSE                            // LATCH is not active, so set route and LATCH
      THROW(17)
      DELAY(20)
      ACTIVATEL(BayExitStarter)
      LATCH(ROUTE_TOGGLE)         // LATCH ROUTE_TOGGLE to indicate route set
    ENDIF
  DONE

TURNOUT(17, 30, 1, "Bay to Shed") // DCC turnout/point with linear address 117

ALIAS(BayExitStarter, 107)        // Starter Signal with Route board
ALIAS(ROUTE_TOGGLE, 11)           // State flag to toggle

ROUTE(11, "Bay to Shed")
  IF(ROUTE_TOGGLE)             // If ROUTE_TOGGLE is active, reset the route
    DEACTIVATEL(BayExitStarter)
    DELAY(20)
    CLOSE(17)
    UNLATCH(ROUTE_TOGGLE)           // UNLATCH (Clear) ROUTE_TOGGLE
  ELSE                            // LATCH is not active, so set route and LATCH
    THROW(17)
    DELAY(20)
    ACTIVATEL(BayExitStarter)
    LATCH(ROUTE_TOGGLE)         // LATCH ROUTE_TOGGLE to indicate route set
  ENDIF
DONE

In this example, LATCH/UNLATCH is used to start/stop a separate running sequence.

    ROUTE(1,"Shuttle")
      SETLOCO(3)
      IF(99)
        UNLATCH(99)
        DONE
      ENDIF
      LATCH(99)
    FOLLOW(2)   // this line is not actully needed

    SEQUENCE(2)
      .... move loco etc
      IF(99)
        FOLLOW(2)
      ENDIF
    DONE // will also stop loco

ROUTE(1,"Shuttle")
  SETLOCO(3)
  IF(99)
    UNLATCH(99)
    DONE
  ENDIF
  LATCH(99)
FOLLOW(2)   // this line is not actully needed

  .... move loco etc
  IF(99)
    FOLLOW(2)
  ENDIF
DONE // will also stop loco

LATCH/UNLATCH can be used to maintain the state of a sensor, or can also be used to trigger a virtual sensor to act as a state flag for EXRAIL. As this effects the state of a sensor, it can be tested via IF/IFNOT and will also work with AT/AFTER.

``ONBUTTON( vpin )`` - Event handler for debounced button presses

This new event handler is handy for mimic panel and other buttons that need to perform an action when a button is pressed, rather than having to create a sequence with a combination of ``AFTER`` and ``IF`` statements to debounce a button which quickly becomes very complicated.

This new event handler is handy for mimic panel and other buttons that need to perform an action when a button is pressed, rather than having to create a sequence with a combination of 

 statements to debounce a button which quickly becomes very complicated.

A new event handler to perform actions when a sensor is activated. Like the other sensor triggers such as ``IF``, ``AT``, and ``AFTER``, a negative value can be used for an active high sensor.

A new event handler to perform actions when a sensor is activated. Like the other sensor triggers such as 

|_| > **vpin** - The first pin number connected that you which to change |BR|
|_| > **count** - optional number of pins to change, starting from and including **pin**. Default is one

 - optional number of pins to change, starting from and including 

Fade an LED on a servo driver to specified value taking specified time.

|_| > **vpin** -  pin of the LED |BR|
|_| > **value** - value to fade the pin to |BR|
|_| > **ms** - duration taken to get to the value in milliseconds

This will start a pin/Vpin blinking until such time as it is ``SET``, ``RESET``, or set via a signal operation.

|_| > **onMs** - time/duration for the pin to be on in milliseconds |BR|
|_| > **offMs** - off time/duration in milliseconds

  BLINK(22, 500, 500) // Blink pin 22 at half second intervals

``CONFIGURE_SERVO(vpin, pos1, pos2, profile)`` - Define LED's connected to PCA9685 boards

This command offers a more convenient way of defining an LED connected to a PCA9685 pin, instead of performing the HAL call in halSetup.h

|_| > **vpin** - The VPin the LED is connected to, e.g. 101 for the second pin on the first PCA9685 servo module |BR|
|_| > **pos1** - The desired intensity (brightness) of the LED when turned on, with 0 being off, and 4095 being 100%) |BR|
|_| > **pos2** - The desired intensity (brightness) of the LED when turned off |BR|
|_| > **profile** - the required profile |BR|

 - The VPin the LED is connected to, e.g. 101 for the second pin on the first PCA9685 servo module 

 - The desired intensity (brightness) of the LED when turned on, with 0 being off, and 4095 being 100%) 

 - The desired intensity (brightness) of the LED when turned off 

*Examples:* |BR|
|_| previously in mySetup.h you would have used: |BR|
|_| IODevice::configureServo(112,2437,0,PCA9685::NoPowerOff); |BR|
|_| Now in myAutomation.h use: |BR| |BR|
|_| CONFIGURE_SERVO(111, 2437, 0, PCA9685::NoPowerOff)

configure_servo(vpin, pos1, pos2, profile) - define led's connected to pca9685 boards

``NEOPIXEL( vpin, red, green, blue [,count] )`` - Controls the colour of attached Neopixel LEDs

|_| > **vpin** - The VPin the first Neopixel connected that you which to change|BR|
|_| > **red** - The desired red colour value (0-255) |BR|
|_| > **green** - The desired red colour value (0-255) |BR|
|_| > **blue** - The desired red colour value (0-255) |BR|
|_| > **count** - number of Neopixels to change, starting from and including **vpin**. Default is one |BR|

 - The VPin the first Neopixel connected that you which to change|BR|

|_| NEOPIXEL(100,255,255,255,10)  // set 10 Neopixels LEDs to white starting at vpin 100

NEOPIXEL(100,255,255,255,10)  // set 10 Neopixels LEDs to white starting at vpin 100

neopixel( vpin, red, green, blue [,count] ) - controls the colour of attached neopixel leds

``NEOPIXEL_SIGNAL( signalid, red, green, blue )`` - Controls the colour of attached Neopixel LED

|_| > **signalid** - The VPin the first Neopixel connected that you which to change|BR|

|_| NEOPIXEL_SIGNAL(100,255,255,255)  // set one Neopixel LED to white

NEOPIXEL_SIGNAL(100,255,255,255)  // set one Neopixel LED to white

neopixel_signal( signalid, red, green, blue ) - controls the colour of attached neopixel led

|_| > **vpin** - first VPIN allocated |BR|
|_| > **value** - ??? |BR|
|_| > **param1** - ??? |BR|
|_| > **param2** - ??? |BR|

|_| ANOUT(10000,23,0,0) // will play the 23rd mp3 file. |BR|
|_| ANOUT(10000,23,30,0) // will do the same thing, as well as setting the volume to 30 (maximum value).

ANOUT(10000,23,30,0) // will do the same thing, as well as setting the volume to 30 (maximum value).

    //=======================================================================
    // Play mp3 files from a Micro-SD card, using a DFPlayer MP3 Module.
    // Parameters:
    //   10000 = first VPIN allocated.
    //   10 = number of VPINs allocated.
    //   Serial1 = name of serial port (usually Serial1 or Serial2).
    // With these parameters, up to 10 files may be played on pins 10000-10009.
    // Play is started from EXRAIL with SET(10000) for first mp3 file, SET(10001)
    // for second file, etc.  Play may also be initiated by writing an analogue
    // value to the first pin, e.g. ANOUT(10000,23,0,0) will play the 23rd mp3 file.
    // ANOUT(10000,23,30,0) will do the same thing, as well as setting the volume to
    // 30 (maximum value).
    // Play is stopped by RESET(10000) (or any other allocated VPIN).
    // Volume may also be set by writing an analogue value to the second pin for the player,
    // e.g. ANOUT(10001,30,0,0) sets volume to maximum (30).
    // The EXRAIL sequence may check for completion of play by calling WAITFOR(pin), which will only proceed to the
    // following line when the player is no longer busy.
    // E.g.
    //    SEQUENCE(1)
    //      AT(164)           // Wait for sensor attached to pin 164 to activate
    //      SET(10003)        // Play fourth MP3 file
    //      LCD(4, "Playing") // Display message on LCD/OLED
    //      WAITFOR(10003)    // Wait for playing to finish
    //      LCD(4, "")       // Clear LCD/OLED line
    //      FOLLOW(1)         // Go back to start

    // in myHAL.cpp file use
     // DFPlayer::create(10000, 10, Serial1);
    // or within myAutomation.h file use
     // HAL (DFPlayer, 10000, 10, Serial1)

//=======================================================================
// Play mp3 files from a Micro-SD card, using a DFPlayer MP3 Module.
// Parameters:
//   10000 = first VPIN allocated.
//   10 = number of VPINs allocated.
//   Serial1 = name of serial port (usually Serial1 or Serial2).
// With these parameters, up to 10 files may be played on pins 10000-10009.
// Play is started from EXRAIL with SET(10000) for first mp3 file, SET(10001)
// for second file, etc.  Play may also be initiated by writing an analogue
// value to the first pin, e.g. ANOUT(10000,23,0,0) will play the 23rd mp3 file.
// ANOUT(10000,23,30,0) will do the same thing, as well as setting the volume to
// 30 (maximum value).
// Play is stopped by RESET(10000) (or any other allocated VPIN).
// Volume may also be set by writing an analogue value to the second pin for the player,
// e.g. ANOUT(10001,30,0,0) sets volume to maximum (30).
// The EXRAIL sequence may check for completion of play by calling WAITFOR(pin), which will only proceed to the
// following line when the player is no longer busy.
// E.g.
//    SEQUENCE(1)
//      AT(164)           // Wait for sensor attached to pin 164 to activate
//      SET(10003)        // Play fourth MP3 file
//      LCD(4, "Playing") // Display message on LCD/OLED
//      WAITFOR(10003)    // Wait for playing to finish
//      LCD(4, "")       // Clear LCD/OLED line
//      FOLLOW(1)         // Go back to start

// in myHAL.cpp file use
 // DFPlayer::create(10000, 10, Serial1);
// or within myAutomation.h file use
 // HAL (DFPlayer, 10000, 10, Serial1)

``PLAYSOUND( vpin, fileNumber, volume )`` - Play mp3 files from a Micro-SD card

EXRAIL Function to Play mp3 files from a Micro-SD card, using a DFPlayer MP3 Module.

|_| > **vpin** - VPIN allocated as DFPLayer |BR|
|_| > **fileNumber** - Play the File# |BR|
|_| > **volume** - volume (0-30) |BR|

playsound( vpin, filenumber, volume ) - play mp3 files from a micro-sd card

|_| > **id** - id of the servo to move |BR|
|_| > **position** - position to move to |BR|
|_| |_| |_| |_| • Instant,  |BR|
|_| |_| |_| |_| • Fast (0.5 sec),  |BR|
|_| |_| |_| |_| • Medium (1 sec),  |BR|
|_| |_| |_| |_| • Slow (2 sec) and  |BR|
|_| |_| |_| |_| • Bounce (subject to revision) |BR|

``SERVO2( id, position, duration )`` - Move an animation servo taking duration

Move an animation servo taking duration in milliseconds. *Do NOT use for Turnouts/points*

|_| > **duration** - duration of the move in milliseconds|BR|

servo2( id, position, duration ) - move an animation servo taking duration

``WAITFOR( pin )`` - Wait for a servo motion to complete prior to continuing

The WAITFOR() command instructs EXRAIL to wait for a servo motion to complete prior to continuing.

  // First example defines a servo turnout/point for the coal yard and a signal for the main line.
  TURNOUT(100, 26, 0, "Coal Yard")
  SIGNAL(25, 26, 27)

  // When our turnout/point is closed, the main line is open, so the signal is green.
  ONCLOSE(100)
    GREEN(25)
  DONE

  // When our turnout is closed, the main line is interrupted, so the signal is red.
  ONTHROW(100)
    RED(25)
  DONE

  // This example triggers an automation sequence when a DCC accessory decoder is activated, including waiting for SERVO motions to complete.
  ONACTIVATEL(100)            // Activating DCC accessory decoder with linear address 100 commences the sequence.
    SERVO(101, 400, Slow)     // Move the first servo and wait.
    WAITFOR(101)
    SERVO(102, 300, Medium)   // Move the second servo and wait.
    WAITFOR(102)
    SET(165)                  // Activate a Vpin to turn an LED on.
    SET(166)                  // Activate a second Vpin to turn a second LED on.
  DONE

// First example defines a servo turnout/point for the coal yard and a signal for the main line.
TURNOUT(100, 26, 0, "Coal Yard")
SIGNAL(25, 26, 27)

// When our turnout/point is closed, the main line is open, so the signal is green.
ONCLOSE(100)
  GREEN(25)
DONE

// When our turnout is closed, the main line is interrupted, so the signal is red.
ONTHROW(100)
  RED(25)
DONE

// This example triggers an automation sequence when a DCC accessory decoder is activated, including waiting for SERVO motions to complete.
ONACTIVATEL(100)            // Activating DCC accessory decoder with linear address 100 commences the sequence.
  SERVO(101, 400, Slow)     // Move the first servo and wait.
  WAITFOR(101)
  SERVO(102, 300, Medium)   // Move the second servo and wait.
  WAITFOR(102)
  SET(165)                  // Activate a Vpin to turn an LED on.
  SET(166)                  // Activate a second Vpin to turn a second LED on.
DONE

waitfor( pin ) - wait for a servo motion to complete prior to continuing

``ONACTIVATE( addr, sub_addr )`` - Event handler for 2 part DCC accessory packet value 1

All these "ON" commands are event handlers that trigger a sequence of commands to run when the event occurs. These can vary from the most basic tasks such as setting signals when turnouts are closed or thrown, to triggering complete automation sequences via a DCC accessory decoder.

All these “ON” commands are event handlers that trigger a sequence of commands to run when the event occurs. These can vary from the most basic tasks such as setting signals when turnouts are closed or thrown, to triggering complete automation sequences via a DCC accessory decoder.

|_| > **addr** - DCC address ??? |BR|
|_| > **Sub_addr** - sub-address ???

onactivate( addr, sub_addr ) - event handler for 2 part dcc accessory packet value 1

``ONACTIVATEL( linear )`` - Event handler for linear DCC accessory packet value 1

onactivatel( linear ) - event handler for linear dcc accessory packet value 1

``ONDEACTIVATE( addr, sub_addr )`` - Event handler for 2 part DCC accessory packet value 0

ondeactivate( addr, sub_addr ) - event handler for 2 part dcc accessory packet value 0

``ONDEACTIVATEL( linear )`` - Event handler for linear DCC accessory packet value 0

ondeactivatel( linear ) - event handler for linear dcc accessory packet value 0

``ACTIVATE( addr, sub_addr )`` - Sends a DCC accessory packet with value 1

activate( addr, sub_addr ) - sends a dcc accessory packet with value 1

``ACTIVATEL( linear )`` - Sends a DCC accessory packet with value 1 to a linear address

activatel( linear ) - sends a dcc accessory packet with value 1 to a linear address

``DEACTIVATE( addr, sub_addr )`` - Sends a DCC accessory packet with value 0

deactivate( addr, sub_addr ) - sends a dcc accessory packet with value 0

``DEACTIVATEL( addr )`` - Sends a DCC accessory packet with value 0 to a linear address

deactivatel( addr ) - sends a dcc accessory packet with value 0 to a linear address

Send DCC function ON to specific cab (e.g. coach lights) *Not for Loco use - use FON instead!*

|_| > **cab** - DCC address of your loco |BR|
|_| > **func** - Function number (0-31)

Send DCC function OFF to specific cab (e.g. coach lights) Not for Loco use - use FON instead!

``XFTOGGLE( loco, func )`` - Toggle DCC function on specific loco

|_| > **loco** - DCC address of your loco |BR|

Also refer to :ref:`ex-fastclock/cs-commands:controlling exrail by time`.

``ONTIME( value )`` - Event handler for when the specified time is reached

ontime( value ) - event handler for when the specified time is reached

``ONCLOCKTIME( hours, mins )`` - Event handler for when the specified clock time is reached

|_| > **hour** - hour to test against |BR|
|_| > **minute** - minute to test against

onclocktime( hours, mins ) - event handler for when the specified clock time is reached

``ONCLOCKMINS( mins )`` - Event handler to be repeated the same time every hour

onclockmins( mins ) - event handler to be repeated the same time every hour

``SENDLOCO( loco, route )`` - Start route/sequence with a specified loco

Start a new task send a specified loco along a specified route/sequence

|_| > **route** - route to execute using the specified loco

sendloco( loco, route ) - start route/sequence with a specified loco

|_| > **speed** - DCC speed (0-127) |BR|
|_| |_| |_| |_| • 2-127 = speed 1-126  |BR|
|_| |_| |_| |_| • 0 = stop  |BR|
|_| |_| |_| |_| • 1 = Estop

``SPEED( speed )`` - Drive loco in current direction at DCC speed

Toggle off the specified function for the current loco.  i.e. Turn off if on, or on if off.

``ROSTER( loco, "name", "func_map" )`` - Provide roster info for a specified loco

|_| > **loco** - DCC address of your loco
|_| > **name** - the name of this loco that will appear in the throttle apps. Enclosed in quotes (") |BR|
|_| > **funct_map** - the names that you want to see for the functions specific to this loco separated by forward slashes ("/"). All enclosed in quotes (") |BR|
|_| |_| |_| |_| Note that if the function is 'momentary' rather than 'latching' (On/Off) then start the function label with a asterisk (*). The most common example of this is the Horn/Whistle which is commonly on F2. |BR|

 - the name of this loco that will appear in the throttle apps. Enclosed in quotes (”) 

 - the names that you want to see for the functions specific to this loco separated by forward slashes (“/”). All enclosed in quotes (”) 

Note that if the function is ‘momentary’ rather than ‘latching’ (On/Off) then start the function label with a asterisk (*). The most common example of this is the Horn/Whistle which is commonly on F2. 

|_| ROSTER (  3,"Eng 3", "F0/F1/\*F2/\*F3/F4/F5/F6/F7/Mute/F9//") // Address 3, Eng 3, Function keys F0-F10 |BR|
|_| ROSTER(1224,"PE 1224","") // Motor Only Decoder |BR|
|_| ROSTER(1225,"PE 1225","Lights/Bell/\*Whistle/\*Short Whistle/Steam/On-Time/FX6 Bell Whistle/Dim Light/Mute") |BR|
|_| ROSTER(4468,"LNER 4468","//Snd On/\*Whistle/\*Whistle2/Brake/F5 Drain/Coal Shvl/Guard-Squeal/Loaded/Coastng/Injector/Shunt-Door \~Opn-Cls/Couplng/BrakeVlv/Sfty Vlv/Shunting/BrkSql Off/No Momentm/Aux3/Fade Out/F22 Res/F23/Res//Aux 5/Aux6/Aux7/Aux 8")

roster( loco, "name", "func_map" ) - provide roster info for a specified loco

Program CV value on main, must be proceeded by setting the loco ID with ``SETLOCO( loco )``

Program CV value on main, must be proceeded by setting the loco ID with 

``IFLOCO( loco )`` - perform commands if the specified loco ID is defined for this sequence

If the specified loco ID is defined for this sequence, perform the defined activities

|_| > **loco** - DCC Address of the loco to test against

  // A defined automation sequence that will do activities only if loco ID 123 is in use
  AUTOSTART AUTOMATION(1, "Do stuff for loco 123")
    IFLOCO(123)
      // Define activities here e.g. blow horn or whistle
    ENDIF
    DONE

// A defined automation sequence that will do activities only if loco ID 123 is in use
AUTOSTART AUTOMATION(1, "Do stuff for loco 123")
  IFLOCO(123)
    // Define activities here e.g. blow horn or whistle
  ENDIF
  DONE

ifloco( loco ) - perform commands if the specified loco id is defined for this sequence

Configures the mode of the selected track, refer also to :doc:`/trackmanager/index`

|_| > **track** - - The track to configure, valid options are A to H |BR|
|_| > **mode** - - The mode to set the track to, |BR|
|_| |_| |_| |_| valid options for |DCC| are: |BR|
|_| |_| |_| |_| • ``MAIN`` or |BR|
|_| |_| |_| |_| • ``MAIN_INV`` or |BR|
|_| |_| |_| |_| • ``MAIN_AUTO`` or |BR|
|_| |_| |_| |_| • ``PROG``, |BR|
|_| |_| |_| |_| and valid options for |DC| are: |BR|
|_| |_| |_| |_| •  ``DC`` or |BR|
|_| |_| |_| |_| •  ``DC_INV`` or |BR|
|_| |_| |_| |_| •  ``DCX`` (same as DC_INV). |BR|
|_| |_| |_| |_| If a track is unused, it can be set to: |BR|
|_| |_| |_| |_| • ``NONE``, |BR|
|_| |_| |_| |_| If the |EX-CS| is confgured as a Booster (ESP32 Microcontrollers only), it can be set to: |BR|
|_| |_| |_| |_| • ``BOOST`` or |BR|
|_| |_| |_| |_| • ``BOOST_INV`` or |BR|
|_| |_| |_| |_| • ``BOOST_AUTO``. |BR|

 is confgured as a Booster (ESP32 Microcontrollers only), it can be set to: 

Deprecated alias of ``AUTO`` but only when preceded by a separate ``MAIN`` command.

When setting at track mode to either ``DC`` or ``DC_INV`` / ``DCX``, you must use the ``SETLOCO( loco )`` command first to specify the loco ID that will be used for the DC track then SET_TRACK()

 command first to specify the loco ID that will be used for the DC track then SET_TRACK()

  // Set both tracks A and B to be main DCC tracks
  AUTOSTART
  SET_TRACK(A, MAIN)
  SET_TRACK(B, MAIN)
  DONE

  // Set track A to be a DC track with loco ID 1, and track B to be a DCC programming track
  AUTOSTART
  SETLOCO(1) SET_TRACK(A, DC)
  SET_TRACK(B, PROG)
  DONE

// Set both tracks A and B to be main DCC tracks
AUTOSTART
SET_TRACK(A, MAIN)
SET_TRACK(B, MAIN)
DONE

// Set track A to be a DC track with loco ID 1, and track B to be a DCC programming track
AUTOSTART
SETLOCO(1) SET_TRACK(A, DC)
SET_TRACK(B, PROG)
DONE

``SET_POWER( track, ON/OFF )`` - Enable/Disable power on a track

Configures the power setting of the selected track, refer also to :doc:`/trackmanager/index`

Configures the power setting of the selected track, refer also to 

|_| > **ON/OFF** - - Turn the power ON or OFF for this track |BR|

  // Set track A to be a DC track with loco ID 1 and power on, and track B to be a DCC programming track
  AUTOSTART
  SET_POWER(A, ON)
  DONE

// Set track A to be a DC track with loco ID 1 and power on, and track B to be a DCC programming track
AUTOSTART
SET_POWER(A, ON)
DONE

The settings achievable vary slightly depending upon the processor running the |EX-CS| but broadly follow the following:

The settings achievable vary slightly depending upon the processor running the 

|_| > **frequency** - - The frequency to set for this track |BR|
|_| |_| |_|>valid options are: |BR|
|_| |_| |_| |_|> **0** - Default - low frequency 131Hz |BR|
|_| |_| |_| |_|> **1** - Mid frequency - 490Hz |BR|
|_| |_| |_| |_|> **2** - High frequency - 3400Hz |BR|
|_| |_| |_| |_|> **3** - Supersonic - 62500Hz |BR|

Trial and error will be needed for specific locos that do not respond well to the defaults (low) frequency setting.

``ONOVERLOAD( track )`` - Event handler for when an Overload occurs

Creates an event handler for the selected track, to be executed when the MotorDriver routines detect and overload. Refer also to :doc:`/trackmanager/index`

Creates an event handler for the selected track, to be executed when the MotorDriver routines detect and overload. Refer also to 

|_| > **track** - - The track to configure, valid options are A to H

``AFTEROVERLOAD( track )`` - Event handler for when an Overload clears

Creates a complementary event handler for the selected track, to be executed when the MotorDriver routines indicate the overload is cleared. Refer also to :doc:`/trackmanager/index`

Creates a complementary event handler for the selected track, to be executed when the MotorDriver routines indicate the overload is cleared. Refer also to 

Note:  AFTEROVERLOAD is only relevant when used within and ONOVERLOAD.... DONE structure.

Note:  AFTEROVERLOAD is only relevant when used within and ONOVERLOAD…. DONE structure.

The power calculation routines within |DCC-EX| will check for shorts and overloads and will change the state of the power produced by the MotorDriver board to protect both it and locos from damage.  This is usually evident by the LED's on the MotorDriver board flashing.  However some users may wish to see some physical notification of these events.  This can now be achieved with EXRAIL and the ONOVERLOAD event.

 will check for shorts and overloads and will change the state of the power produced by the MotorDriver board to protect both it and locos from damage.  This is usually evident by the LED’s on the MotorDriver board flashing.  However some users may wish to see some physical notification of these events.  This can now be achieved with EXRAIL and the ONOVERLOAD event.

This first example shows a warning message to an attached screen with an LED being illuminated to warn the user of the overload.  Once the overload is cleared the AFTEROVERLOAD code is run automatically.

  ONOVERLOAD(A)       // the EXRAIL statement to control the event.
    SCREEN(2,0, "OVERLOAD ON TRACK A")     // A message to the second screen
    PRINT("Overload Detected on Track A")   // Message to system moniter
    SET(27)                                 // Turn on an LED perhaps
    AFTEROVERLOAD(A)
        SCREEN(2,0, "RESTORE A POWER ON")
        PRINT("Overload Cleared on A - Power Restored")
        RESET(27)                           // Turn off the LED
        DELAY(2000)
        SCREEN(2,0, "                  ")   // Clear the screen message
  DONE

If the user wishes to turn off power whilst he/she investigates the problem, then this can be achieved using the second example below.  POWEROFF can be used, but this will turn off power to all tracks.  Power to the track with the problem can be turned off with a TrackManager command.  However in order to execute the AFTEROVERLOAD routine it is necessary to have a reset routine.

  // This is the event triggered by an overload.  AFTEROVERLOAD cannot be triggered whilst power is OFF.
  ONOVERLOAD(A)
    SCREEN(2,0, "OVERLOAD A POWEROFF")
    PRINT("Overload Detected on A - Turn Off Power")
    SET_TRACK(A, NONE)   // Unsets the TrackManager assignment and turns off power.
    SET(27)              // Light the LED
        RESET(27)
        SCREEN(2,0, "                  ")
  DONE

  // The following turns the power on and allows the AFTEROVERLOAD to run
  // This could also be achieved with a physical button and AFTER(pin) in place of ROUTE()
  ROUTE(12,"Reset A")
    SCREEN(2,0,"                  ")
    SET_TRACK(A, MAIN)
    POWERON
  DONE

ONOVERLOAD(A)       // the EXRAIL statement to control the event.
  SCREEN(2,0, "OVERLOAD ON TRACK A")     // A message to the second screen
  PRINT("Overload Detected on Track A")   // Message to system moniter
  SET(27)                                 // Turn on an LED perhaps
  AFTEROVERLOAD(A)
      SCREEN(2,0, "RESTORE A POWER ON")
      PRINT("Overload Cleared on A - Power Restored")
      RESET(27)                           // Turn off the LED
      DELAY(2000)
      SCREEN(2,0, "                  ")   // Clear the screen message
DONE

// This is the event triggered by an overload.  AFTEROVERLOAD cannot be triggered whilst power is OFF.
ONOVERLOAD(A)
  SCREEN(2,0, "OVERLOAD A POWEROFF")
  PRINT("Overload Detected on A - Turn Off Power")
  SET_TRACK(A, NONE)   // Unsets the TrackManager assignment and turns off power.
  SET(27)              // Light the LED
      RESET(27)
      SCREEN(2,0, "                  ")
DONE

// The following turns the power on and allows the AFTEROVERLOAD to run
// This could also be achieved with a physical button and AFTER(pin) in place of ROUTE()
ROUTE(12,"Reset A")
  SCREEN(2,0,"                  ")
  POWERON
DONE

afteroverload( track ) - event handler for when an overload clears

Reserve a block (0-255). If already reserved, current loco will STOP and sequence waits for block to become free

|_| > **block_id** - Block to reserve (0-255)

``IFRESERVE( block_id )`` - Execute commands if block is NOT reserved

If block is NOT reserved, reserve it and run commands in the IF block. Otherwise, skip to matching ENDIF

ifreserve( block_id ) - execute commands if block is not reserved

|_| > **row** - row of the LED/OLD to write the message |BR|
|_| > **msg** - message to write

``SCREEN( display, row, "msg" )`` - Writes a message to a display

|_| > **display** - which display to write to ??? |BR|

``BROADCAST( "msg" )`` - Broadcast to all throttles/JMRI on serial and WiFi

broadcast( "msg" ) - broadcast to all throttles/jmri on serial and wifi

``WITHROTTLE( "msg" )`` - Writes a message to WiThrottle clients

Writes a message to all serial throttles and all WiThrottle Clients.

A |DCC-EX| throttle will receive a broadcast ``<m "text">``, and a WiThrottle throttle will receive ``Hmtext``.

Join PROG and MAIN track outputs to send the same MAIN DCC signal.

``PARSE( "msg" )`` - Allows parsing of a DCC-EX API command via myAutomation.h

Allows parsing of a DCC-EX API command via myAutomation.h.  This allows you to include Native DCC-EX Cammands in myAutomation.h where there is no equivalent EXRAIL command.

parse( "msg" ) - allows parsing of a dcc-ex api command via myautomation.h

``IO_NO_HAL`` - Reduce FLASH footprint when HAL features not required

Note: The HAL is disabled by default on Nano and Uno platforms, because of limited flash space.

io_no_hal - reduce flash footprint when hal features not required

The following commands have been introduced to support Layout Command Control (LCC) / CBUS.

|_| > **sender** - TBA |BR|
|_| > **eventid** - TBA

|_| > **senderid** - TBA |BR|

Any commands in this section are intended for |engineer| level users that have advanced knowledge of how |EX-R| works, and likely some understanding of C++ coding as well.

If you are unsure on the impacts using anything in this section may have, please reach out to the |DCC-EX| team via the methods listed on our :doc:`/support/contact-us` page.

If you are unsure on the impacts using anything in this section may have, please reach out to the 

Permits a certain level of C++ code to be embedded as a single step in an EXRAIL sequence.

Please use this option with great care.  If in doubt ask for assistance.

  // run a routine to free any LATCHES that are left on.
  SEQUENCE(999)
        STEALTH(  //RESET ANY LATCHES WE TURNED ON
        for (int i = 1; i <= 255; i++) {
          if (getFlag(i,LATCH_FLAG)) {    //IF LATCH ON
          setFlag(i,0,LATCH_FLAG);      //RESET LATCH
            }
          }
        )
  RETURN

  then
  CALL(999) inside your onthrow/onclose sections.

// run a routine to free any LATCHES that are left on.
SEQUENCE(999)
      STEALTH(  //RESET ANY LATCHES WE TURNED ON
      for (int i = 1; i <= 255; i++) {
        if (getFlag(i,LATCH_FLAG)) {    //IF LATCH ON
        setFlag(i,0,LATCH_FLAG);      //RESET LATCH
          }
        }
      )
RETURN

then
CALL(999) inside your onthrow/onclose sections.

Inserts code such as static variables and functions that may be utilized by multiple ``STEALTH`` operations.

Inserts code such as static variables and functions that may be utilized by multiple 

Please use this option with great care, and you will need to be an advanced C++ user to make use of this command.  If in doubt ask for assistance.

.. contents:: In This Section
    :depth: 4
    :local:
    :class: in-this-section

Hyperlink target "exrail-conditional-statements" is not referenced.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/420>`_ - Finish this page -  Decoder Notes

|EX-CS| works with virtually any decoder using its proprietary programming and ACK detection features. Still, while running locos and sending commands to the main track will always work, you may run into issues during programming operations with ACK Detection. This page describes fixes for any of the decoders users or the |DCC-EX| team found.

 works with virtually any decoder using its proprietary programming and ACK detection features. Still, while running locos and sending commands to the main track will always work, you may run into issues during programming operations with ACK Detection. This page describes fixes for any of the decoders users or the 

The NMRA specification says that a properly operating decoder will acknowledge commands by sending an "ACK pulse" that is 60mA above the idle track current for 6 milliseconds. However, despite |EX-CS| giving a wide margin or tolerance around these, some decoders are so far out of specification, that you may have to upload a change to your command station to get them to program properly.

The NMRA specification says that a properly operating decoder will acknowledge commands by sending an “ACK pulse” that is 60mA above the idle track current for 6 milliseconds. However, despite 

 giving a wide margin or tolerance around these, some decoders are so far out of specification, that you may have to upload a change to your command station to get them to program properly.

Have a link to "Programming Mobile decoders, aka. Reading and Writing CVs" and write that document

Have a link to “Programming Mobile decoders, aka. Reading and Writing CVs” and write that document

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/420>`_

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/422>`_ - Finish the above and the below sections

Hardware that works with EX-CommandStations or other DCC-EX products. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

**As of version 5.4.0, this is no longer a recommended option, see :doc:`/news/posts/20240328`**

As of version 5.4.0, this is no longer a recommended option, see :doc:`/news/posts/20240328`

The Arduino Nano is an Uno in disguise. It has the same processor, the same speed, the same (small) amount of memory. It's just small. The disadvantage is that you can't plug shields on top of it, but the benefit is that it can fit in a small box. You can always use all the same Uno shields, like the full-sized |motor shield|, you just have to solder or use wire jumpers to make the connections.

The Arduino Nano is an Uno in disguise. It has the same processor, the same speed, the same (small) amount of memory. It’s just small. The disadvantage is that you can’t plug shields on top of it, but the benefit is that it can fit in a small box. You can always use all the same Uno shields, like the full-sized 

, you just have to solder or use wire jumpers to make the connections.

Validate none of the limitations of a Nano will prevent you using features you will need by reading through the section on :ref:`ex-commandstation/advanced-setup/index:microcontrollers`.

Validate none of the limitations of a Nano will prevent you using features you will need by reading through the section on 

.. figure:: /_static/images/microcontrollers/nano.png
   :alt: Arduino Nano

   Arduino Nano

Gravitech Nano Motor Shield (or clone, or any supported |motor shield|)

5V 1A Power Supply with Mini-USB for Arduino and Micro-USB for clones

Barrel Connector to Screw Terminal Adapter if using the Nano Motor Shield

See :doc:`Command Station Download Page </download/ex-commandstation>`

:doc:`Command Station Download Page </download/ex-commandstation>`

Supported :doc:`ESP8266 WiFi Option </reference/hardware/wifi-boards>`

Before you order a Nano, be sure whether the headers are soldered or not. The Arduino brand is not soldered, while many of the Chinese sites give you the option. If you are a conductor, you probably don't want to solder. If you are an Engineer, you may want to solder directly to the board and having to unsolder headers would be an unwelcome surprise.

Before you order a Nano, be sure whether the headers are soldered or not. The Arduino brand is not soldered, while many of the Chinese sites give you the option. If you are a conductor, you probably don’t want to solder. If you are an Engineer, you may want to solder directly to the board and having to unsolder headers would be an unwelcome surprise.

.. Figure:: /_static/images/motorboards/nano_gravitech.png
   :alt: Gravitech Nano Motor Shield
   :scale: 20%
   :align: left

   Gravitech Nano Motor Shield

.. Figure:: /_static/images/motorboards/nano_cheap_motor_shield.png
   :alt: Nano Motor Shield Clone

   Nano Motor Shield Clone

The above image shows a Gravitech Nano Motor Shield on the left, and a clone from China on the right. The image on the left shows a Nano (separately purchased) plugged into the board. Search "Nano Motor Shield" or "Nano-L298p". And remember to order a Nano from the same source or from someone else.

The above image shows a Gravitech Nano Motor Shield on the left, and a clone from China on the right. The image on the left shows a Nano (separately purchased) plugged into the board. Search “Nano Motor Shield” or “Nano-L298p”. And remember to order a Nano from the same source or from someone else.

The Gravitech is available from RobotShop and direct from Gravitech for $29 US plus shipping. The Chinese clone costs between $9 and $18 (shipping included) from sources like AliExpress, eBay, Amazon, etc.

There is a slight difference in the brand name Gravitech board and the board from the Chinese suppliers. There is a reset button on the Chinese board for one. We will post more information when we can test them side-by-side.

To use this board, you simple plug the Nano into the motor shield (really a carrier board), upload the software and wire it to your track. It is just as easy as Using a Mega and an Arduino Motor shield.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/422>`_ - Show VCC power wiring option

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/422>`_

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/422>`_ - Show all the other Nano sized terminal boards and the ethernet board

 - Show all the other Nano sized terminal boards and the ethernet board

You will need jumpers to connect the Nano to the Arduino Motor Shield

As long as you know the pinouts, you can jumper wires to any motor shield you can connect to an Uno or Mega.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/426>`_ - Fritzing image of 2 ibt 2 boards here

.. figure:: /_static/images/motorboards/ibt_2_bts7960.png
   :alt: IBT_2 Board

   IBT_2 Board

This board can supply a LOT of current. The maximum recommended current is 5A for N and HO scale

:dcc-ex-red-bold-italic:`This board can supply a whopping 43A`, enough to cause a LOT of damage.

To use this board, make sure you have fuses or circuit breakers connected in line with both rails. *SOFTWARE ALONE CANNOT PROTECT YOU IN ALL CASES.*

To use this board, make sure you have fuses or circuit breakers connected in line with both rails. 

You will either need 2 of these or one of these and another board to run your programming track. Most people using this board use the Arduino Motor shield for the program track and add this board for MAIN. These boards can provide high current. We have built boosters using these boards.

If the 2 Amps (really 1.5A) of the L298 boards or the 5 Amps of the |EX-MS| aren't enough for your track, this is one of the best options. IBT_2 is the manufacturer's name for this board, BTS7960 is the model number of the H-Bridge chip used as the |motor driver|. The H-Bridge generates a clean wave form, has very low signal propagation delay and no significant voltage drop.

If the 2 Amps (really 1.5A) of the L298 boards or the 5 Amps of the 

 aren’t enough for your track, this is one of the best options. IBT_2 is the manufacturer’s name for this board, BTS7960 is the model number of the H-Bridge chip used as the 

. The H-Bridge generates a clean wave form, has very low signal propagation delay and no significant voltage drop.

   :alt: IBT_2 Motor driver

   IBT_2 Motor driver

An Arduino Mega or clone (or an Uno if you don't need WiFi or Ethernet)

An Arduino Mega or clone (or an Uno if you don’t need WiFi or Ethernet)

An Arduino Motor Shield (or another board for your service track for the upgrade option)

An IBT_2 Motor Board (1 board for the upgrade option, 2 for the replace option)

For this option, we assume that many of you may have started off with the Arduino Mega with Arduino Motor Shield (or clones) and are here because you are making the step up to something that can handle more current, and therefore more locos. We will cover two options for how to use your IBT_2 motor board:

**"Upgrade"** - Using ONE output of your Arduino Motor Shield to control your PROG track and ONE IBT_2 board to run your MAIN track.

 - Using ONE output of your Arduino Motor Shield to control your PROG track and ONE IBT_2 board to run your MAIN track.

**"Replace"** - Using TWO IBT_2 boards to handle BOTH the MAIN and PROG tracks. You won't need another |motor driver|. This is a Tinkerer or perhaps an Engineer option since it requires a little more knowledge and abilities.

 - Using TWO IBT_2 boards to handle BOTH the MAIN and PROG tracks. You won’t need another 

. This is a Tinkerer or perhaps an Engineer option since it requires a little more knowledge and abilities.

We can't say it enough, this board can pump out some Amps. Be careful! Put fuses on the connection to each rail and limit the current to a safe level in your config.h file. We have a saying at |DCC-EX|, if you need more than 5 Amps to run locos, then you need to add power districts, not more Amps. The voltage to the track will be 2 to 3 volts higher using the same power supply than it is with Arduino type (L298) motor boards.

We can’t say it enough, this board can pump out some Amps. Be careful! Put fuses on the connection to each rail and limit the current to a safe level in your config.h file. We have a saying at 

, if you need more than 5 Amps to run locos, then you need to add power districts, not more Amps. The voltage to the track will be 2 to 3 volts higher using the same power supply than it is with Arduino type (L298) motor boards.

The IBT_2 uses N-Channel Power MOSFETS (a type of Transistor) inside its 2 BTS7960B Integrated Circuits. Each of those ICs makes is just a half H-Bridge circuit, it takes two of them to make the full H-Bridge. Don't be confused, each of these boards can only handle one track. The Arduino board is a DUAL full H-Bridge, that is how it can handle 2 tracks.

The IBT_2 uses N-Channel Power MOSFETS (a type of Transistor) inside its 2 BTS7960B Integrated Circuits. Each of those ICs makes is just a half H-Bridge circuit, it takes two of them to make the full H-Bridge. Don’t be confused, each of these boards can only handle one track. The Arduino board is a DUAL full H-Bridge, that is how it can handle 2 tracks.

Anything with MOSFETS in them is more efficient than something with Bipolar Junction Transistors (BJTs) like the L298 on the Arduino and Deek Robot Motor Shields. That means **there is no voltage drop to the tracks** like there is for those boards. Keep that in mind because that means **there can be an extra 2 to 3 volts to your track**. Your trains will run faster than they did before and things could overheat if they were able to handle the 12V reaching the track from a 14.5V power supply, but don't like the full 14+ volts.

Anything with MOSFETS in them is more efficient than something with Bipolar Junction Transistors (BJTs) like the L298 on the Arduino and Deek Robot Motor Shields. That means 

 like there is for those boards. Keep that in mind because that means 

. Your trains will run faster than they did before and things could overheat if they were able to handle the 12V reaching the track from a 14.5V power supply, but don’t like the full 14+ volts.

These options both use the "standard accuracy" waveform (This means the 1 and 0 pulses can vary a tiny bit from their 58 and 116uS duration). This is not a problem for virtually all decoders and would usually only be noticed by a sniffer checking the signal for accuracy (Like EX-DCCInspector).

We use 2 GPIO pins to generate the DCC signal. This saves you from having to create a small 1 transistor and 2 resistor inverter circuit to only use 1 pin. If you want to use "high accuracy" mode because you need to free an Arduino pin or some other reason, and you like to solder, please see :doc:`High Accuracy Waveform Mode </reference/hardware/motorboards/high-accuracy>`.

These options both use the “standard accuracy” waveform (This means the 1 and 0 pulses can vary a tiny bit from their 58 and 116uS duration). This is not a problem for virtually all decoders and would usually only be noticed by a sniffer checking the signal for accuracy (Like EX-DCCInspector).

We use 2 GPIO pins to generate the DCC signal. This saves you from having to create a small 1 transistor and 2 resistor inverter circuit to only use 1 pin. If you want to use “high accuracy” mode because you need to free an Arduino pin or some other reason, and you like to solder, please see 

:doc:`High Accuracy Waveform Mode </reference/hardware/motorboards/high-accuracy>`

The main benefit of using the upgrade option, keeping the Arduino Motor Shield for programming and adding the IBT_2 for providing more current for your MAIN track, is that you already have a working system for programming, and therefore need to make fewer changes. The other reason is that current sensing for programming requires more sensitivity that simply being able to detect a short condition, which is all you need on MAIN.

The circuitry on the Arduino Motor Shield is designed to measure current from just 0 to 2 Amps in the 1023 steps of the analog input pin of an Arduino Mega (it has a 10 bit analog-to-digital converter (ADC)), and 10 bits can hold an integer from 0 to 1023). Measuring 5 or 10 amps in the same number of steps obviously means a loss of resolution. This is not necessarily a bad thing, but is worth noting.

It would be possible to just use fuses to both rails of your MAIN track to protect for shorts on the track and not have to have an external current sense board as long at you also had protection in your power supply to protect against a short in the board itself. Just note that without a current sense board, the Command Station would not be able to automatically turn off power to the board in the event of a short and current monitoring, like in the |JMRI| DCC++ monitor, will not report main track current.

It would be possible to just use fuses to both rails of your MAIN track to protect for shorts on the track and not have to have an external current sense board as long at you also had protection in your power supply to protect against a short in the board itself. Just note that without a current sense board, the Command Station would not be able to automatically turn off power to the board in the event of a short and current monitoring, like in the 

The main benefit of the replace option, using 2 IBT_2 boards, is that you don't have to have two different types of boards. If you are building a new Command Station and don't already have an Arduino Motor Shield, you will need two of the IBT_2 boards.

The main benefit of the replace option, using 2 IBT_2 boards, is that you don’t have to have two different types of boards. If you are building a new Command Station and don’t already have an Arduino Motor Shield, you will need two of the IBT_2 boards.

To use this option *and* be able to program locos, you **must** have an current sense capability. These boards *do* have a current sense output, but you may want to modify that or use an external current sense board. We will cover more about that later. Accurate current sense lets you detect the acknowledgement (ACK) pulses from a loco on your programming track. It also allows the Command Station to monitor for a short and automatically cut the power to the tracks if there is an overload condition (a short).

 have a current sense output, but you may want to modify that or use an external current sense board. We will cover more about that later. Accurate current sense lets you detect the acknowledgement (ACK) pulses from a loco on your programming track. It also allows the Command Station to monitor for a short and automatically cut the power to the tracks if there is an overload condition (a short).

For this installation we are going to assume you already have a working Command Station or at least have all the parts you need as listed above.

If you need instructions on how to install the Arduino Motor Shield, see :doc:`Arduino Motor Shield Assembly </ex-commandstation/diy/assembly>`

If you need instructions on how to install the Arduino Motor Shield, see 

:doc:`Arduino Motor Shield Assembly </ex-commandstation/diy/assembly>`

Use just 1 output of your existing Arduino Motor Shield for your program track with no hardware changes

Add an IBT_2 (BTS7960) Motor Board to replace the "A" output of the motor shield to power your MAIN track

Add an IBT_2 (BTS7960) Motor Board to replace the “A” output of the motor shield to power your MAIN track

Instead of bending out the current sense pin of the Arduino Motor Shield and using the same A0 pin for the IBT_2 current sense, we are using pin A5.

Both outputs of the motor shield are still connected, we just don't enable the A or main side. DO NOT try to use the A output of the motor shield! You will have no current sense and no short circuit protection.

Both outputs of the motor shield are still connected, we just don’t enable the A or main side. DO NOT try to use the A output of the motor shield! You will have no current sense and no short circuit protection.

Make sure all power supplies are disconnected from your Arduino, The Motor Shield, and the IBT_2

Disconnect the wires coming out of output A of the Arduino Motor Shield that normally connect to your MAIN track.

Move the two wires we just disconnected from the motor shield and connect them to the M+ and M- Screw terminals of the IBT_2. If you will be using power districts or wanting to connect the main and prog tracks together when prog is not in use, keep the polarity of the rails the same with reference to each other. In other words, if you connect + to the left rail, then always keep + on the rail to the left as viewed from a train sitting on the track. We need to keep the phase of the DCC signal in sync between power districts.

Option - You may need to connect or solder a 10k or smaller resistor between pin 5 or 6 and ground on the IBT_2 (shown as R1 in :numref:`ibt2-wiring-schematic`). There should already be a 10k resistor on each chip (double check the values on your board!), which gives us a resistance of 5k when we connect both current sense outputs together. See the notes below for more detail about current sense and a suggestion for using an external current sense board.

Option - You may need to connect or solder a 10k or smaller resistor between pin 5 or 6 and ground on the IBT_2 (shown as R1 in 

). There should already be a 10k resistor on each chip (double check the values on your board!), which gives us a resistance of 5k when we connect both current sense outputs together. See the notes below for more detail about current sense and a suggestion for using an external current sense board.

The diagrams below also show an optional diode protection circuit. If you don't test your board first to make sure that the current you will be using does not put more that 5V on your Arduino analog pin, this will keep you from destroying the input. It is a 5 or 5.1 zener diode (1N4733A, 1N5231B, NZX5V1B, BZX55C5V1, or the high wattage 1N5338B). R2 should be **220 Ohms**.

The diagrams below also show an optional diode protection circuit. If you don’t test your board first to make sure that the current you will be using does not put more that 5V on your Arduino analog pin, this will keep you from destroying the input. It is a 5 or 5.1 zener diode (1N4733A, 1N5231B, NZX5V1B, BZX55C5V1, or the high wattage 1N5338B). R2 should be 

Use the following diagrams to connect pins from the Arduino Mega to the IBT_2:

Here is a visual diagram. R1 (current sense modifier), R2 (diode current limiter = 220 Ohms) and D1 (5.1V Zener protection diode) are optional. See current sense notes below. Click to enlarge:

.. figure:: /_static/images/motorboards/ibt_wiring.png
   :alt: IBT_2 Wiring 1
   :name: ibt2-wiring-schematic

   Wiring Schematic

It should look like following. Note we have included the Arduino Mega and have the Arduino Motor shield off to the side for reference. The |motor shield| would obviously normally be stacked on top of the Arduino.

It should look like following. Note we have included the Arduino Mega and have the Arduino Motor shield off to the side for reference. The 

However, some people might not use the |motor shield| and instead will have another board to use for their programming track. In this case, they would connect the IBT_2 to the same pins directly on the Arduino microcontroller.

 and instead will have another board to use for their programming track. In this case, they would connect the IBT_2 to the same pins directly on the Arduino microcontroller.

Also note the jumper wiring that shows pin 4 or the Arduino connecting to pins 3 and 4 on the IBT_2 and A5 connected to pins 5 and 6. As with most of our diagrams, you can click on them to enlarge them.

.. figure:: /_static/images/motorboards/ibt_2_wiring_fritz.png
   :alt: IBT_2 Wiring 2

   Wiring visual layout

We are going to edit your config.h file. If this is your first time using the Command Station software and you do not have a config.h file, rename your config.example.h file to config.h.

Launch the |Arduino IDE| (or whatever editor you use) and open the CommandStation-EX project. Find the config.h file. look for the following lines of code:

 (or whatever editor you use) and open the CommandStation-EX project. Find the config.h file. look for the following lines of code:

// DEFINE MOTOR_SHIELD_TYPE BELOW ACCORDING TO THE FOLLOWING TABLE:
//
//  STANDARD_MOTOR_SHIELD : Arduino Motor shield Rev3 based on the L298 with 18V 2A per channel
//  POLOLU_MOTOR_SHIELD   : Pololu MC33926 Motor Driver (not recommended for prog track)
//  FUNDUMOTO_SHIELD      : Fundumoto Shield, no current sensing (not recommended, no short protection)
//  IBT_2_WITH_ARDUINO    : IBT_2 Motor Board on MAIN and Arduino Motor Shield on PROG
//  FIREBOX_MK1           : The Firebox MK1
//  FIREBOX_MK1S          : The Firebox MK1S
//   |
//   +-----------------------
//
#define MOTOR_SHIELD_TYPE STANDARD_MOTOR_SHIELD

Change the last line to look like this. To be sure of your spelling, you can copy and paste IBT_2_WITH_ARDUINO to replace STANDARD_MOTOR_SHIELD

Upload the sketch to your Arduino. If you need help on how to upload a sketch, see :doc:`Getting Started </ex-commandstation/index>`

Upload the sketch to your Arduino. If you need help on how to upload a sketch, see 

This section will cover how to use 2 IBT_2 boards, one for MAIN and one for PROG if you do not already have an Arduino Motor Shield or clone. Be careful as the IBT_2 can deliver much more current than you need for a programming track. If you install 1 Amp fuses in between the IBT_2 outputs and both rails of your programming track, that and the lower trip current we set in the Command Station for the programming track should protect your layout.

Use Two (2) IBT_2 (BTS7960) Motor Boards to run your MAIN and PROG tracks

Use jumper wires to connect the IBT_2 to the Arduino and the IBT_2 outputs to your tracks

You will need some form of current sense if you wish to program locos and detect overload conditions (short circuit) on your tracks.

The same rules as above apply to using 2 boards. The only difference is that we would use one IBT_2 board for Main and another for PROG. That wiring would look like this:

Use the following diagrams to connect pins from the Arduino Mega to the IBT_2 for your MAIN track:

Use the following diagrams to connect pins from the Arduino Mega to the IBT_2 for your PROG track:

Make sure your board has the expected current sensing resistors (see below) and that their value is correct for the maximum current you expect to use. Also, make sure you don't apply more than 5V to the Arduino Analog pin. Our calculations use NOMINAL values, but these chips can vary widely in how much voltage they report per Amp of current at the output. The value of your resistor will also affect this.

Make sure your board has the expected current sensing resistors (see below) and that their value is correct for the maximum current you expect to use. Also, make sure you don’t apply more than 5V to the Arduino Analog pin. Our calculations use NOMINAL values, but these chips can vary widely in how much voltage they report per Amp of current at the output. The value of your resistor will also affect this.

Please do the following to ensure you won't damage the Arduino, your layout, or yourself:

Please do the following to ensure you won’t damage the Arduino, your layout, or yourself:

Test your board to see what voltage it reports for 2 or 3 different currents and extrapolate to make sure that at your required current, example 5A, the current sense output does not produce more than 5V.

Use a 5.1V zener diode (D1) and current limiting resistor (R2). This should be 220 Ohms, which will protect you from 5.2V to at least 12V of over voltage at the Arduino analog pin. The Diode can be 5V or 5.1V like a 1N4733A, 1N5231B, etc. Note that after 3.5V the response is no longer linear when using the diode, so you you may want to design your system to output its current sense range between 0 and 4V and use 5V as the over limit setting.

Check your board for at least 2 resistors that are labelled "103", you will need a magnifier or to take a picture with your phone and zoom in. 103 = 10k (10 followed by 3 zeros). These are the second from the left resistor in each bank of 4 (R5 and R6). See :numref:`ibt2-sense-resistors`. When we tie the two Command Station outputs together, that gives us 5k of resistance from which to measure a voltage drop and convert that to current. If you added another 10k resistor (R1) in parallel with the others, that would give you 3.3k which reduces the voltage to the Arduino analog pin to be able to measure higher currents.

Check your board for at least 2 resistors that are labelled “103”, you will need a magnifier or to take a picture with your phone and zoom in. 103 = 10k (10 followed by 3 zeros). These are the second from the left resistor in each bank of 4 (R5 and R6). See 

. When we tie the two Command Station outputs together, that gives us 5k of resistance from which to measure a voltage drop and convert that to current. If you added another 10k resistor (R1) in parallel with the others, that would give you 3.3k which reduces the voltage to the Arduino analog pin to be able to measure higher currents.

.. figure:: /_static/images/motorboards/ibt_2_resistors.jpg
   :alt: IBT_2 Resistors
   :name: ibt2-sense-resistors

   10k (103) current sense resistors

The spec sheet of the BTS7960B states that the "expected" (aka nominal) value for the ratio of output current to the current reported at the current sense pin is 8500 to 1. That means if you have 1 Amp of output current you will get .176 mA of current at the Command Station pin.

The spec sheet of the BTS7960B states that the “expected” (aka nominal) value for the ratio of output current to the current reported at the current sense pin is 8500 to 1. That means if you have 1 Amp of output current you will get .176 mA of current at the Command Station pin.

If we apply that through our 5k of resistance (V = I*R) we would see .588 Volts at the output connected to our Arduino analog pin. Since the response is linear, we get .588 Amps per Volt. If we have 3A of current to the track, we would have 1.75V. And for 5 Amps, the voltage would be 2.94V. So far, so good, BUT, the tolerance and difference between what is "expected" and what will pass as "acceptable" is huge.

If we apply that through our 5k of resistance (V = I*R) we would see .588 Volts at the output connected to our Arduino analog pin. Since the response is linear, we get .588 Amps per Volt. If we have 3A of current to the track, we would have 1.75V. And for 5 Amps, the voltage would be 2.94V. So far, so good, BUT, the tolerance and difference between what is “expected” and what will pass as “acceptable” is huge.

The 8500 ratio we expect can be as low as 3000 and has high as 14,000! This means that a 3A current can be reported as anything from 1V to 5V on the CS pin.

But what happens at 5A on one of these boards? |BR| The answer is that you could have as much as 8.33V connected to your Arduino! In other words, **You could destroy the analog input pin on your Arduino**.

 The answer is that you could have as much as 8.33V connected to your Arduino! In other words, 

Use a known current on your track and measure the current sense voltage for your board before connecting it to your command station.

If you are going to use more than 3 Amps, you should add a 10k or less current sense resistor (R1) and a 5.1V Zener diode and a 220 Ohm series resistor protection circuit (D1 and R2).

See the section above "Important Notes on Current Sensing".

An additional 10k resistor would give you .392 Volts per Amp and will require a small change to your sketch to adjust your current conversion factor (usually a value of 10). A 2.2k resistor would allow you to measure up to 10A, but the larger the current range, the less sensitivity and accuracy you can get.

Besides, we should use boosters and power districts if we need more than 5 Amps, right? ;)

If you add a parallel resistor to increase your current sensing range or find your readings are not correct, you will need to adjust your current sense factor. For an unmodified board, a value of 7 is usually good. If you add a 10k parallel resistor to get more current range, you probably need to change it to 10. If you can test with known resistance values to know exactly what voltage it reported to your analog pin for 2 or more currents, you can use a simple formula to calculate it.

Everything you need to create your own motor board definition is here:

:ref:`Creating a Custom Motor Board Definition <reference/hardware/motorboards/motor-board-config:if your board is not in the supported list>`

modifying your motor board definition to give the correct current sense factor

Using an external current sense board instead of the onboard current sense included with the IBT_2 can give us a little more control over the sensitivity of our circuit (ability to read low currents such as one N scale loco sitting still on the track.

Circuits and boards we tested are the MAX471 (up to 3A), the Pololu ACS724 (5A or 10A boards), and a 5A current sense transformer for use with one output wire wrapped through it going directly to the track.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/426>`_ - Add help or point to a section for external current sense boards

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/426>`_

 - Add help or point to a section for external current sense boards

Mean Well LRS-150-15
Enclosed Switchable Power Supply 1U Profile, 150W 15V 10A
http://amazon.com/gp/product/B019GYOPSS/ |EXTERNAL-LINK|
$23.38 +tax; prime shipping

ELEGOO MEGA 2560 R3 Board ATmega2560 ATMEGA16U2 + USB Cable
https://www.amazon.com/gp/product/B01H4ZLZLQ |EXTERNAL-LINK|
$16.99 +tax; prime shipping

ACS724 Current Sensor Carrier 0 to 10A (this one has 400mv/A sensitivity)
https://www.pololu.com/product/4042 |EXTERNAL-LINK|
$9.95 + $3.95 shipping

DuPont pin M/F jumper wires 20cm – an assortment is fine
https://www.amazon.com/dp/B07GD2BWPY |EXTERNAL-LINK|
$5.79 +tax; prime shipping

Single Motor Driver Board H-Bridge IBT_2, 3-36V, 15A, Peak 43A
various sellers, prices and delivery methods. $7 to $14.
Here is a pack of two:
https://www.amazon.com/dp/B07TFB22H5/ |EXTERNAL-LINK|
$15.51 +tax; prime shipping

The choice of motor driver is set in the config.h file. It is set in the following line:

The default is "STANDARD_MOTOR_SHIELD" For Arduino and clone shields.

The default is “STANDARD_MOTOR_SHIELD” For Arduino and clone shields.

If you want to change your motor shield or create a definition for one that does not yet have built-in support, you can follow the simple instructions in the :doc:`Motor Board Config Section </reference/hardware/motorboards/motor-board-config>`

If you want to change your motor shield or create a definition for one that does not yet have built-in support, you can follow the simple instructions in the 

:doc:`Motor Board Config Section </reference/hardware/motorboards/motor-board-config>`

The definitions and implementation for motor board control are in the following files:

**MotorDrivers.h**  - Contains the definitions for all the currently supported motor drivers |BR|
**MotorDriver.h** - Creates the "MotorDriver" C++ class that defines the data type for a |motor driver| |BR|
**MotorDriver.cpp** - The routines that control the operation of a |motor driver| (Power, Current Sense, etc.)

Normally you would never need to get into these files, we just mention them because it can be helpful to see the examples in the code if you want to learn more about how to customise your motor board definition or see how things work.

  - Contains the definitions for all the currently supported motor drivers 

 - Creates the “MotorDriver” C++ class that defines the data type for a 

.. image:: /_static/images/schematics/IBT_2_schematic.jpg
   :scale: 50

Below is the Handson Technology datasheet, recommended reading for Tinkerers and Engineers

`Handson Technology BTS7960 High Current 43A H-Bridge Motor Driver <../../../_static/documents/bts7960-motor-driver.pdf>`_

Handson Technology BTS7960 High Current 43A H-Bridge Motor Driver

handson technology bts7960 high current 43a h-bridge motor driver

TODO: this has to go somewhere:

There are two ways to monitor motor board current, one is at the input of the board and the other is at the output. We will cover both of these methods in the :ref:`advanced-setup/supported-motorboards/IBT_2-motor-board-setup:Important Notes on Current Sensing (IBT_2)` section.

Also, mention "high accuracy mode" and include the circuit for that.

.. figure:: /_static/images/motorboards/3205_motor_board.png
   :alt: IRF3205 Motor Board

   IRF3205 Motor Board

This board can supply a LOT of current. The maximum recommended current is 5A for N and HO scale. This board can supply 15A, enough to cause a LOT of damage. To use this board, make sure you have fuses or circuit breakers connected in line with both rails. SOFTWARE ALONE CANNOT PROTECT YOU IN ALL CASES. You will also need external current sense.

You can use this board to handle both your MAIN and PROG track, or you can use one of the H-Bridges to power your MAIN track and use the Arduino Motor Shield for your PROG track. This board can provide up to 15A when you need more current than the 1.2-1.5A the Arduino Motor Shield can provide. IRF3205 is the model number of the N Channel MOSFETS used in the H-Bridge circuit. MOSFETS are a type of transistor, and rather than many other boards that use an integrated circuit for the H-Bridge, this board uses 4 discrete transistors per H-Bridge. This allows for a highly efficient |motor driver| with a negligible voltage drop.

You can use this board to handle both your MAIN and PROG track, or you can use one of the H-Bridges to power your MAIN track and use the Arduino Motor Shield for your PROG track. This board can provide up to 15A when you need more current than the 1.2-1.5A the Arduino Motor Shield can provide. IRF3205 is the model number of the N Channel MOSFETS used in the H-Bridge circuit. MOSFETS are a type of transistor, and rather than many other boards that use an integrated circuit for the H-Bridge, this board uses 4 discrete transistors per H-Bridge. This allows for a highly efficient 

An Arduino Motor Shield (If you are upgrading or already have an Arduino Motor Shield)

A 12-18V DC (depending on train scale) power supply rated for the current you need (we recommend 5A)

A separate current sense board like one based on the ACS724 chip (or just depend on the 5A fuses)

See the :ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Parts list (IRF3205)`

reference/hardware/motorboards/IRF3205-motor-board-setup:Parts list (IRF3205)

.. figure:: /_static/images/motorboards/15A_Dual_HBridge.png
   :alt: 15A Dual H-Bridge

   15A Dual H-Bridge

We assume that many of you may have started off with the Arduino Mega with Arduino Motor Shield (or clones) and are here because you are making the step up to something that can handle more current, and therefore more locos. We will cover two options for how to use your IRF3205 motor board:

**"Upgrade"** - Using ONE output of your Arduino Motor Shield to control your PROG track and ONE output of your IRF3205 board to run your MAIN track.

 - Using ONE output of your Arduino Motor Shield to control your PROG track and ONE output of your IRF3205 board to run your MAIN track.

**"Replace"** - Using BOTH outputs of the IRF3205 board to handle BOTH the MAIN and PROG tracks. You won't need a second |motor driver|. This is a Tinkerer or perhaps an Engineer option since it requires a little more knowledge and abilities.

 - Using BOTH outputs of the IRF3205 board to handle BOTH the MAIN and PROG tracks. You won’t need a second 

We can't say it enough, this board can pump out some Amps. Be careful! Put fuses on the connection to each rail and limit the trip (short circuit) current to a safe level in your config.h file. We have a saying at DCC-EX, if you need more than 5 Amps to run locos, then you need to add power districts, not more Amps.

We can’t say it enough, this board can pump out some Amps. Be careful! Put fuses on the connection to each rail and limit the trip (short circuit) current to a safe level in your config.h file. We have a saying at DCC-EX, if you need more than 5 Amps to run locos, then you need to add power districts, not more Amps.

The IRF3205 is actually the part number of the transistors on the board, N-Channel Power MOSFETS specifically. It takes 4 of them to make one full H-Bridge circuit to control one track. This board has 2 sets of 4 for 2 H-Bridges. You may find other boards that use this transistor, but this guide only covers the 15A Dual H-Bridge pictured above. Anything with MOSFETS in them is more efficient than something with Bipolar Junction Transistors (BJTs) like the L298 on the Arduino and Deek Robot Motor Shields. That means **there is no voltage drop to the tracks** like there is for those boards. Keep that in mind because that means **there can be an extra 2 to 3 volts to your track**. Your trains will run faster than they did before and things could overheat if they were able to handle the 12V reaching the track from a 14.5V power supply, but don't like the full 14+ volts.

The IRF3205 is actually the part number of the transistors on the board, N-Channel Power MOSFETS specifically. It takes 4 of them to make one full H-Bridge circuit to control one track. This board has 2 sets of 4 for 2 H-Bridges. You may find other boards that use this transistor, but this guide only covers the 15A Dual H-Bridge pictured above. Anything with MOSFETS in them is more efficient than something with Bipolar Junction Transistors (BJTs) like the L298 on the Arduino and Deek Robot Motor Shields. That means 

This board can use the "High Accuracy Waveform" option since it uses just one direction pin per H-Bridge. As long as you use one of our motor board definitions for MOTOR_BOARD_TYPE in your config.h file that uses a Timer1 pin, this will all be automatic. See :doc:`High Accuracy Waveform </reference/hardware/motorboards/high-accuracy>`.

This board can use the “High Accuracy Waveform” option since it uses just one direction pin per H-Bridge. As long as you use one of our motor board definitions for MOTOR_BOARD_TYPE in your config.h file that uses a Timer1 pin, this will all be automatic. See 

:doc:`High Accuracy Waveform </reference/hardware/motorboards/high-accuracy>`

The main benefit of using the upgrade option, keeping the Arduino Motor Shield for programming and adding the IRF3205 for providing more current for your MAIN track, is that you already have a working system for programming, and therefore need to make fewer changes. The other reason is that current sensing for programming requires more sensitivity that simply being able to detect a short condition, which is all you need on MAIN.

The main benefit of the replace option, using only the IRF3205 board, is that you only need one board. If you are building a new Command Station and don't already have an Arduino Motor Shield, you can save money and space by not having to buy another board.

The main benefit of the replace option, using only the IRF3205 board, is that you only need one board. If you are building a new Command Station and don’t already have an Arduino Motor Shield, you can save money and space by not having to buy another board.

To use this option *and* be able to program locos, you **must** have an external current sense board so you can detect the acknowledgement (ACK) pulses from a loco on your programming track. The current sensor also allows the Command Station to monitor for a short and automatically cut the power to the tracks if there is an overload condition (a short).

 have an external current sense board so you can detect the acknowledgement (ACK) pulses from a loco on your programming track. The current sensor also allows the Command Station to monitor for a short and automatically cut the power to the tracks if there is an overload condition (a short).

There are two ways to monitor motor board current, one is at the input of the board and the other is at the output. We will cover both of these methods in the :ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Important Notes on Current Sensing` section.

There are two ways to monitor motor board current, one is at the input of the board and the other is at the output. We will cover both of these methods in the 

:ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Important Notes on Current Sensing`

reference/hardware/motorboards/IRF3205-motor-board-setup:Important Notes on Current Sensing

Tinkerers will use their existing motor shield for PROG and replace the MAIN output with one of the outputs of this board. Engineers can skip to :ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Replacing (Use both IRF3205 outputs to control MAIN and PROG)` to see how to modify the board so that just the IRF3205 can manage both tracks.

Tinkerers will use their existing motor shield for PROG and replace the MAIN output with one of the outputs of this board. Engineers can skip to 

:ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Replacing (Use both IRF3205 outputs to control MAIN and PROG)`

reference/hardware/motorboards/IRF3205-motor-board-setup:Replacing (Use both IRF3205 outputs to control MAIN and PROG)

 to see how to modify the board so that just the IRF3205 can manage both tracks.

Use just ONE output (the "B" Output) of your existing Arduino Motor Shield for your program track with no hardware changes

Use just ONE output (the “B” Output) of your existing Arduino Motor Shield for your program track with no hardware changes

Add an IRF3205 Motor Board to replace the "A" output of the motor shield to power your MAIN track

Add an IRF3205 Motor Board to replace the “A” output of the motor shield to power your MAIN track

Add a current sense board and fuses (or just fuses for Engineers)

Instead of bending out the current sense pin of the Arduino Motor Shield and using the same A0 pin for the IBT_2 current sense, we are using pin A3. Both outputs of the motor shield are still connected, we just don't enable the A, or main, side of the Arduino Motor Shield. DO NOT try to use the A output of the motor shield! You will have no current sense and no short circuit protection.

Instead of bending out the current sense pin of the Arduino Motor Shield and using the same A0 pin for the IBT_2 current sense, we are using pin A3. Both outputs of the motor shield are still connected, we just don’t enable the A, or main, side of the Arduino Motor Shield. DO NOT try to use the A output of the motor shield! You will have no current sense and no short circuit protection.

Make sure all power supplies are disconnected from your Arduino, The Motor Shield, and the IRF3205 motor board.

Disconnect the wires coming out of output A of the Arduino Motor Shield that normally connects to your MAIN track.

Move the two wires we just disconnected from the motor shield and connect one to each of the "Motor1" screw terminals of the IRF3205 board.

Move the two wires we just disconnected from the motor shield and connect one to each of the “Motor1” screw terminals of the IRF3205 board.

NOTE: It is important that the phase of the signal to your PROG and MAIN tracks are the same if you are ever going to use the ``<1 JOIN>`` command to make both tracks a MAIN when the PROG track is not in use, or if you are going to use the "DriveAway" feature. For more detail, see :ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Keeping your tracks in phase` below.

NOTE: It is important that the phase of the signal to your PROG and MAIN tracks are the same if you are ever going to use the 

 command to make both tracks a MAIN when the PROG track is not in use, or if you are going to use the “DriveAway” feature. For more detail, see 

:ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Keeping your tracks in phase`

reference/hardware/motorboards/IRF3205-motor-board-setup:Keeping your tracks in phase

Use the following diagrams to connect pins from the Arduino Mega to the IRF3205. "CS" in the table means "Current Sense":

Use the following diagrams to connect pins from the Arduino Mega to the IRF3205. “CS” in the table means “Current Sense”:

Here is a visual diagram. See :ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Important Notes on Current Sensing`. Click to enlarge:

.. image:: /_static/images/motorboards/IRF3205_w_arduino_fritz.png
   :alt: IRF3205 Wiring Diagram
   :scale: 38%

It should look like following. Note we have included the Arduino Mega and have the Arduino Motor shield off to the side for reference. The motor shield would obviously normally be stacked on top of the Arduino. However, some people might not use the motor shield and instead will have another board to use for their programming track. In this case, they would connect the IRF3205 (TODO: What does this mean? Did I mean to connect this other board to those pins or the IRF3205?? Fix this in the IBT_2 board page also) to the same pins on the Arduino microcontroller. As with most of our diagrams, you can click on them to enlarge them. )

.. image:: /_static/images/motorboards/IRF3205_w_arduino.png
   :alt: IRF3205 Wiring Schematic

Remove the last line and replace it with this. To be sure of your spelling, you can copy and paste everything:

#define MOTOR_SHIELD_TYPE IRF3205_ARDUINO_ACS724

#define IRF3205_ARDUINO_ACS724 F("IRF3205_ARDUINO_ACS724"), \
  new MotorDriver(3, 12, UNUSED_PIN, UNUSED_PIN, A3, 12.2, 6000, UNUSED_PIN), \
  new MotorDriver(11, 13, UNUSED_PIN, UNUSED_PIN, A1, 2.99, 2000, UNUSED_PIN)

This will use pin 3 for Enable and 12 for signal, which will use the "High Accuracy" waveform. You could use other pins that line up together if you like and use "Standard" accuracy.

This will use pin 3 for Enable and 12 for signal, which will use the “High Accuracy” waveform. You could use other pins that line up together if you like and use “Standard” accuracy.

Upload the new sketch to your Arduino. If you need help on how to upload a sketch, see :doc:`Getting Started </ex-commandstation/index>`

Upload the new sketch to your Arduino. If you need help on how to upload a sketch, see 

If you intend to use your Command station for programming on a separate programming track, or you will want to monitor current on your main track, you will connect an external current sense board. See the notes below for more detail about current sense and a suggestion for using an external current sense board.

See :ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Important Notes on Current Sensing`

This option requires a small external current sense board wired in series with the DC power into the board. This monitors the total current the board uses, so cannot measure the MAIN and PROG tracks separately. You will need to turn off power to MAIN ``<0 MAIN>`` when programming. There is an option to use 2 current sense boards at the output to each track (requires bi-directional current sense boards) or to create a break in the power trace on the board to one of the H-Bridge circuits to monitor DC input current separately. Those options are covered in the :ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Tech Notes (IRF3205)` section.

This option requires a small external current sense board wired in series with the DC power into the board. This monitors the total current the board uses, so cannot measure the MAIN and PROG tracks separately. You will need to turn off power to MAIN 

 when programming. There is an option to use 2 current sense boards at the output to each track (requires bi-directional current sense boards) or to create a break in the power trace on the board to one of the H-Bridge circuits to monitor DC input current separately. Those options are covered in the 

reference/hardware/motorboards/IRF3205-motor-board-setup:Tech Notes (IRF3205)

This section will cover how to the MOTOR1 output to control MAIN and MOTOR2 to control PROG if you do not already have an Arduino Motor Shield or clone. Be careful as the IRF3205 can deliver much more current than you need for a programming track. If you install 1 Amp fuses in between the IRF3205 Motor2 outputs and both rails of your programming track, that and the lower trip current we set in the Command Station for the programming track should protect your layout and your locos.

Use both outputs of your IRF3205 15A board (MOTOR1 and MOTOR2) to control your MAIN and PROG track

Add a current sense board and fuses (you MUST have current sense to program locos)

Make sure all power supplies are disconnected from your Arduino and the IRF3205 motor board.

Option - See the notes below for more detail about current sense and a suggestion for using an external current sense board.

Connect wires of the proper gauge (TODO: see gauge) from the "MOTOR1" screw terminals of the IRF3205 board to your MAIN track and connect 2 more wires from the "MOTOR2" terminals to your PROG track.

Connect wires of the proper gauge (TODO: see gauge) from the “MOTOR1” screw terminals of the IRF3205 board to your MAIN track and connect 2 more wires from the “MOTOR2” terminals to your PROG track.

It is important that the phase of the signal to your PROG and MAIN tracks are the same if you are ever going to use <1 JOIN> to make both tracks a MAIN when the PROG track is not in use, or if you are going to use the "DriveAway" feature.

It is important that the phase of the signal to your PROG and MAIN tracks are the same if you are ever going to use <1 JOIN> to make both tracks a MAIN when the PROG track is not in use, or if you are going to use the “DriveAway” feature.

Option - TODO: fnd current sense / fuses! |BR|
Select your IRF3205 board - TODO: fnd need to add this type
Note: TODO: finish this. How do know phase?

It should look like following graphical image. Note we have included the Arduino Mega and have the Arduino Motor shield off to the side for reference. The motor shield would obviously normally be stacked on top of the Arduino. However, some people might not use the motor shield and instead will have another board to use for their programming track. In this case, they would connect the IRF3205 directly to the same pins on the Arduino microcontroller. Please use fuses on BOTH wires of the output to your MAIN track. As with most of our diagrams, you can click on them to enlarge them.

Here is a wiring diagram. See :ref:`reference/hardware/motorboards/IRF3205-motor-board-setup:Important Notes on Current Sensing` below. Click on images to enlarge them:

Pay attention to board labels, not their position on this drawing. Your current sensor may have its connections wired differently! Here is a schematic image to help clarify the wiring.

If you want to use more than 5A (but we recommend not to), there are changes you need to make to the hardware AND to the config.h settings. See TODO: link to section below.

#define MOTOR_SHIELD_TYPE IRF3205_ACS724

#define IRF3205_ACS724 F("IRF3205_ACS724"), \
  new MotorDriver(3, 12, UNUSED_PIN, UNUSED_PIN, A0, 12.2, 6000, UNUSED_PIN), \

This will us pin 3 for Enable and 12 for signal, which will use the "High Accuracy" waveform. You could use other pins that line up together if you like and use "Standard" accuracy (TODO: Link to note explaining high accuracy).

This will us pin 3 for Enable and 12 for signal, which will use the “High Accuracy” waveform. You could use other pins that line up together if you like and use “Standard” accuracy (TODO: Link to note explaining high accuracy).

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_ - organise the above and add pictures

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_ - Finish this section

You MUST have current sensing if you want to read or write settings to locos on a programming track (PROG). You also must have current sensing in order to have the Command Station software detect an overload and cut power to the MAIN track. Alternately, you can use fuses for MAIN. If the fuses blow, the Command Station will still think there is power to the track, and you will receive no notification in the log. Also, make sure you don't apply more than 5V to the Arduino Analog pin. Ensure that your calculation for what voltage the current sense board will report at the maximum current will not be more than 5V for a 5V Arduino or 3.3V for a Command Station using a 3.3V board (like a Teensy or Feather).

You MUST have current sensing if you want to read or write settings to locos on a programming track (PROG). You also must have current sensing in order to have the Command Station software detect an overload and cut power to the MAIN track. Alternately, you can use fuses for MAIN. If the fuses blow, the Command Station will still think there is power to the track, and you will receive no notification in the log. Also, make sure you don’t apply more than 5V to the Arduino Analog pin. Ensure that your calculation for what voltage the current sense board will report at the maximum current will not be more than 5V for a 5V Arduino or 3.3V for a Command Station using a 3.3V board (like a Teensy or Feather).

Please do the following to verify you won't damage the Arduino, your layout, or yourself:

Please do the following to verify you won’t damage the Arduino, your layout, or yourself:

Test your current sense board to see what voltage it reports for 2 or 3 different currents and extrapolate to make sure that at your required current, example 5A, the output going to pin A3 of the Command Station does not produce more than 5V.

Consider using a 5V Zener diode and current limiting resistor to clamp the voltage on the analog pin. This would normally be a 270 Ohm resistor.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_ - finish this - Using Other External Current Sense Boards

Circuits and boards we tested are the MAX471 (up to 3A), the Pololu ACS724 (10A+), and a 5A current sense transformer for use with one output wire wrapped through it going directly to the track.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_ - Add help or point to a section for external Command Station boards

 - Add help or point to a section for external Command Station boards

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_ - Finish this. Sense Current at the Tracks instead of the motor board input

 - Finish this. Sense Current at the Tracks instead of the motor board input

For the Engineers, the definitions and implementation for motor board control are in the following files:

**MotorDrivers.h**  - Contains the definitions for all the currently supported motor drivers
**MotorDriver.h** - Creates the "MotorDriver" C++ class that defines the data type for a |motor driver|

  - Contains the definitions for all the currently supported motor drivers

`MEDIUM - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_ - this is wrong - IRF3205 15A Motor Board schematic

`MEDIUM - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_

If you are an Engineer will be using the <1 JOIN> command to connect the main and prog tracks together when prog is not in use, keep the polarity of the rails the same with reference to each other. In other words, if you connect + to the left rail, then always keep + on the rail to the left as viewed from a train sitting on the track. We need to keep the phase of the DCC signal in sync between power districts.

To check phase, Put an AC Voltmeter with one lead on the LEFT rail on PROG and the other lead on the left rail on MAIN. If the meter measures an AC voltage near track voltage (around 17-20 VAC normally) then reverse one of the power wires to one of the tracks at the track or at the motor board output. Test again.It should now read 0 Volts AC.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_ - Finish this section - Keeping Your tracks in Phase

Dual Motor Driver Board H-Bridge IRF3205, 3-36V, 10A, Peak 30A
various sellers, prices and delivery methods. $16 and higher.
https://www.amazon.com/gp/product/B087PF8CZM |EXTERNAL-LINK|
$24.40 +tax; prime shipping

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/427>`_ - See the PDF file IRF3205_mega_ACS724 in trains folder to include here

 - See the PDF file IRF3205_mega_ACS724 in trains folder to include here

If you intend to use more than 5A of current though this board, we recommend using heat sinks.

Heat sinks must be insulated! The metal tabs on the transistors are connected to their drain (the middle pin). If you touched the metal of heat sink that was not insulated, or an uninsulated heat sink connected to one transistor touched the heatsink connected to another transistor, the results could be bad. You can used one big heat sink to connect the transistors, but you would have to use proper mounting hardware and thermal compound. Ideas below

TODO: finish and remove these comments
XXX put images of thermal double sides tape or the mica and screw solution

1. Current sense on the input of the board for both tracks
2. Curent sense at the motor board outputs (to the tracks) for separate measurement
3. Cut the thick trace on the board and have separate current sense to each H-Bridge

from chris, re not using <1 JOIN> Alternatively you can connect the tracks through a dpdt relay and drive that with the feature that sets a gpio pin when joined...

Add to mySetup.h
DCC::setJoinRelayPin(n)

more TODO: What about the motor shield main output we aren't using? Any pins to bend out? Ground current sense? Don't think so on the latter.

What does the ACS724 report for 6 or 7 amps? How to make sure it doesn't go over 5V to the Arduino analog pin.

put a note somewhere in the second install that measuring at the input means the current is for both tracks and that used by the board. We check for an offset, so the board current is cancelled out, but if either track has a short, both tracks cut out. Can't have locos anywhere when programming.Current sensing for IRF3205 motor board.

To use the IRF3205 motor board with a common current sense module, turn off main when programming.

Note that I was able to successfully read several decoders with 0-10A and +/-10A external current sensors, but not the recent model SD70Ace Genesis w/Tsunami2 OEM sound decoder.

Locoduino site shows a method for separating the channels and adding a MAX471.
https://forum-locoduino-org.translate.goog/index.php?topic=843.msg10416&_x_tr_sl=fr&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc,elem#msg10416

I wonder if the 1.5 ohm 3 watt resistor could be added to this setup instead of the MAX471.

Perhaps the two channels of the IRF3205 motor board would be better utilised for two power districts.

Perhaps anyone who is up to the challenges of the IRF3205 would also be able to add the 1.5 ohm resistor to the L298N motor board.

But take a step back.  What to recommend?
1.  Mega + motor shield
2.  Add a motor board if more power is needed for main track
 a.  IBT_2
   or
 b.  IRF3205 + external current sensor

And consider adding the LEDs to confirm when tracks are powered.  I like using two LEDs per output instead of LED/diode -- if only one is lit, there is a problem...

make a note about how current sense is affected by 3.3V boards

-- instructions at:  https://www.locoduino.org/spip.php?article253
where IRF3205 is incorrectly identified as L9110S.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/428>`_ - finish this page

The L298N Motor board is the same H-Bridge on the Arduino Motor Shield. Here are the key differences:

It isn't a shield so you have to jumper wires to connect it to your CS

It isn’t a shield so you have to jumper wires to connect it to your CS

It doesn't have current sense, so you are going to have to use one of the solutions below

It doesn’t have current sense, so you are going to have to use one of the solutions below

It stands vertically on the board with a big heat sink for better cooling

.. figure:: /_static/images/motorboards/l298_board.png
  :alt: L298N Motor Board

  L298N Motor Board

You may wonder why one would go through the trouble of using this board when the Arduino / Deek-Robot Motor Shield already has what we need and is a recommended option. The answer is you may want to use this board because:

You are not using an Arduino for your Command Station and a shield is unwieldy

You are going to use the L298N for programming and something with more current for MAIN

It does not have much more current output than the Arduino Motor Shield

You will need to have currense sense in order to program locos on the programming (service) track. In addition, current sense is necessary to provide short-circuit detection for each track. There are two methods to add current sensing to this board, the first method requires cutting two leads on the IC and soldering in current sense resistors. The other method is to use an external current sense board to measure the current going into the board.

This is easier than it sounds and takes about 15 minutes. To do this yourself, you will need:

If you will only be using this board for the programming track and another board like the IBT_2 for your MAIN track, you only need one resistor and can follow the instructions for just the B side of the procedure.

You can either cut or lift legs on the L298 chip and insert resistors, or cut a trace on the back of the board and insert the resistors there.

Choose how you will insert your current sense resistors from the following two options:

.. figure:: /_static/images/motorboards/l298_board4.jpg
  :alt: L298N lift legs to solder CS resistors
  :scale: 50%

  Lift or cut chip legs on front

.. figure:: /_static/images/motorboards/l298nbackmodify.png
  :alt: L298N cut traces to install CS resistors
  :scale: 45%

  Cut traces and solder on back

Unsolder or cut the A and B current sense legs on the L298N chip at the green circles being careful to lift them out without breaking them. Pin 1 to the left is output Command Station ``Output A`` for MAIN. Pin 15 to the right is Command Station ``Output B`` for PROG.

Unsolder or cut the A and B current sense legs on the L298N chip at the green circles being careful to lift them out without breaking them. Pin 1 to the left is output Command Station 

Lift each leg and bend them carefully upward to provide space for a resistor.

Cut one wire lead of the 1 Ohm resistor short, but long enough that you can solder that end into the hole left by unsoldering the Command Station leg, about 1/4" (6mm). This connects one end of the resistor to ground. Solder the resistor from the bottom leaving air space for cooling. Repeat on the other side.

Cut one wire lead of the 1 Ohm resistor short, but long enough that you can solder that end into the hole left by unsoldering the Command Station leg, about 1/4” (6mm). This connects one end of the resistor to ground. Solder the resistor from the bottom leaving air space for cooling. Repeat on the other side.

Solder the leg of the chip you unsoldered to the top of the resistor. You should be able to carefully bend the leg to meet the top resistor lead as the resistor stands vertically. You are basically inserting a resistor into the space where you cut the leg of the chip. Solder the wire fairly close to the end of the resistor. You may need a small piece of hookup wire to reach between the connections. Repeat on the other side. Do not trim the top resistor lead yet.

Measure a jumper wire long enough to connect from the top of resistor A and reach over push into pin A0 on the Arduino. Solder one end of the jumper to the top of resistor A above where you soldered the chip's CS leg. Trim off any remaining resistor lead. Repeat for the resistor on side B making sure the male dupont end of the jumper can reach pin A1 on the Arduino.

Measure a jumper wire long enough to connect from the top of resistor A and reach over push into pin A0 on the Arduino. Solder one end of the jumper to the top of resistor A above where you soldered the chip’s CS leg. Trim off any remaining resistor lead. Repeat for the resistor on side B making sure the male dupont end of the jumper can reach pin A1 on the Arduino.

If you haven't already, plug the male end of the A jumper into pin A0 on the Arduino and the male end of the B jumper to pin A1 on the Arduino.

If you haven’t already, plug the male end of the A jumper into pin A0 on the Arduino and the male end of the B jumper to pin A1 on the Arduino.

Using a razor blade or x-acto knife, carefully cut the ground pads where marked with white lines.

Using the blade, carefully scratch the conformal coating off the back of the circuit board where marked with yellow rectangles to expose the bare copper underneath. Be careful, you just want to scrape away the protective layer, you do not want to cut through the copper here.

Using an Ohmmeter, test for continuity between the newly exposed pads and the leg of the L298N chip on the other side that is soldered to the same pad. Make sure you have an open circuit (infinite resistance). If not, scrape a little more to widen the gap where you cut the trace, being careful not to cut too deep.

Trim the leads of your resistor to fit with one leg soldered to the solder joint of the current sense pin of the L298 and the other lead to the exposed ground pad you scraped clean as shown in the picture.

If you are using both sides of the L298 board for your MAIN and PROG tracks, repeat the process for the other side.

You have two choices regarding how to wire and configure the L298N motor driver board to the command station. Unlike the Arduino Motor Shield, this board has separate direction inputs which is where we apply the DCC signal.

Your first choice, the easy way, is to create a new motor board definition that uses the proper pins. This requires you to edit the config.h file, cut and paste the motor board definition below, upload the sketch with the new settings, and connect wires from the L298N board to the correct pins on the Arduino. The only disadvantage to this method is that is uses an extra pin (though there are plenty of spare pins on a Mega), and it uses the standard accuracy waveform. Standard accuracy is fine for almost all cases, but you can read more on the :doc:`High Accuracy Waveform Mode</reference/hardware/motorboards/high-accuracy>`

Your first choice, the easy way, is to create a new motor board definition that uses the proper pins. This requires you to edit the config.h file, cut and paste the motor board definition below, upload the sketch with the new settings, and connect wires from the L298N board to the correct pins on the Arduino. The only disadvantage to this method is that is uses an extra pin (though there are plenty of spare pins on a Mega), and it uses the standard accuracy waveform. Standard accuracy is fine for almost all cases, but you can read more on the 

:doc:`High Accuracy Waveform Mode</reference/hardware/motorboards/high-accuracy>`

Your second choice is to make a small inverter circuit (using 1 FET, IC, or transistor) to connect to the standard signal pin on the Command Station, and split it into two signals connect to the two pins on the L298N board. The advantage of this method is you use just one pin and get the high accuracy DCC waveform. The downside is that you have to solder together a circuit with 2 or 3 parts.

This method uses 2 pins on the Arduino for DCC signal pins and requires the following custom motor board definition. It uses the standard accuracy DCC waveform. The advantage of this method is that you don't have to wire a transistor and 2 resistors to create an inverter circuit. The disadvantage is you use an extra pin for each track output and you get the standard accuracy waveform. See :doc:`High Accuracy Waveform Mode</reference/hardware/motorboards/high-accuracy>` to see if you really need it.

This method uses 2 pins on the Arduino for DCC signal pins and requires the following custom motor board definition. It uses the standard accuracy DCC waveform. The advantage of this method is that you don’t have to wire a transistor and 2 resistors to create an inverter circuit. The disadvantage is you use an extra pin for each track output and you get the standard accuracy waveform. See 

To wire the board, connect the pins according to the following diagram. A table is included as well. This pin usage, with all the pins lined up between boards, allows the use of a ribbon cable to make things a bit more neat:

.. figure:: /_static/images/motorboards/l298_wiring_2inputs_2tracks.png
  :alt: L298N Motor driver wiring diagram

  L298N 2 signal pin, 2 track wiring diagram

Once wired correctly, edit the config.h file and replace the following line:

#define MY_L298N_BOARD F("MY_L298N_BOARD"),\
   new MotorDriver(7, 6, 5, UNUSED_PIN, A0, 4.88, 2000, UNUSED_PIN), \
   new MotorDriver(2, 4, 3, UNUSED_PIN, A1, 4.88, 2000, UNUSED_PIN)

   #define MOTOR_SHIELD_TYPE MY_L298N_BOARD

Save the file and then upload the entire sketch into the Command Station using the |Arduino IDE| as explained in :doc:`Installing Using the Arduino IDE</ex-commandstation/advanced-setup/installation-options/arduino-ide>`

Save the file and then upload the entire sketch into the Command Station using the 

:doc:`Installing Using the Arduino IDE</ex-commandstation/advanced-setup/installation-options/arduino-ide>`

This method uses 1 signal pin on the Arduino for each track and uses the |standard motor driver| definition. The advantage of this method is that it provides a slightly more accurate DCC waveform that might allow slightly better compatibility with really picky decoders, and you don't have to change the default motor board definition. The disadvantage is that you have to solder a 1 transistor, 2 resistor (or inverter chip) to invert the signal into the 2 inputs on the L298 board.

This method uses 1 signal pin on the Arduino for each track and uses the 

 definition. The advantage of this method is that it provides a slightly more accurate DCC waveform that might allow slightly better compatibility with really picky decoders, and you don’t have to change the default motor board definition. The disadvantage is that you have to solder a 1 transistor, 2 resistor (or inverter chip) to invert the signal into the 2 inputs on the L298 board.

Make the following Inverter circuit (You need 2 if you want MAIN and PROG):

.. figure:: /_static/images/motorboards/inverter1.jpg
  :alt: Transistor inverter circuit

  Transistor inverter circuit

Then wire the L298N to the Arduino with jumper wires according to the following table:

Once wired correctly, make sure your config.h file is configured for a STANDARD_MOTOR_SHIELD. If you have not already uploaded the CommandStation-EX sketch to your Command Station, you can make sure this line is in your config.h:

Save the file if you needed to add this line and then upload the entire sketch into the Command Station using the Arduino IDE as explained in :doc:`Installing Using the Arduino IDE</ex-commandstation/advanced-setup/installation-options/arduino-ide>`

Save the file if you needed to add this line and then upload the entire sketch into the Command Station using the Arduino IDE as explained in 

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/428>`_

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/429>`_ |EXTERNAL-LINK| - description needed for The Motor Board Config

Do you need it? Most likely, you don't. But if you run into a problem with a particular decoder and all the usual settings don't help, you may want to try this mode. We have found that some older decoders do not adhere to the NMRA specification tolerances. They can fail to read bits that are within the proper range. While rare, this could occur. The High Accuracy mode makes the waveform, the pulse train of 1's and 0's, even tighter to the nominal values in the specification.

Do you need it? Most likely, you don’t. But if you run into a problem with a particular decoder and all the usual settings don’t help, you may want to try this mode. We have found that some older decoders do not adhere to the NMRA specification tolerances. They can fail to read bits that are within the proper range. While rare, this could occur. The High Accuracy mode makes the waveform, the pulse train of 1’s and 0’s, even tighter to the nominal values in the specification.

The nominal spec asks for 58us '1' bits and 100us '0' bits, with a few microseconds leeway in either direction. We opted to use 116us '0' bits since it is exactly twice a '1' bit, and made it easy for us to use one timer to generate both bits. On occasion, with all the other things going on inside the |EX-CS|, and the way we use timers and interrupts in normal accuracy mode, it is possible for there also to be a little jitter. That's when the bit durations from bit to bit can vary a few microseconds. High Accuracy Mode uses the hardware timers instead of just our software routine, to tighten up any jitter.

The nominal spec asks for 58us ‘1’ bits and 100us ‘0’ bits, with a few microseconds leeway in either direction. We opted to use 116us ‘0’ bits since it is exactly twice a ‘1’ bit, and made it easy for us to use one timer to generate both bits. On occasion, with all the other things going on inside the 

, and the way we use timers and interrupts in normal accuracy mode, it is possible for there also to be a little jitter. That’s when the bit durations from bit to bit can vary a few microseconds. High Accuracy Mode uses the hardware timers instead of just our software routine, to tighten up any jitter.

The signal pin for the track you want to have high accuracy must be a Timer1 pin

You must use the single signal pin configuration for your motor driver

You do not have to do anything to enable High Accuracy Waveform Mode. If your motor driver config meets the above two criteria, it will be enabled automatically and report that in the |serial monitor| boot log.

You do not have to do anything to enable High Accuracy Waveform Mode. If your motor driver config meets the above two criteria, it will be enabled automatically and report that in the 

You will notice that your motor driver type is set in the *config.h* file. This line sets a |standard motor driver| compatible with the Arduino Motor Driver:

Whether called Motor "boards" or "shields" or "drivers", they are defined in the *MotorDrivers.h* file and look like this:

Whether called Motor “boards” or “shields” or “drivers”, they are defined in the 

#define STANDARD_MOTOR_SHIELD F("STANDARD_MOTOR_SHIELD"), \
  new MotorDriver(3, 12, UNUSED_PIN, UNUSED_PIN, A0, 2.99, 2000, UNUSED_PIN), \

The first line after setting the name and display text is for the Main (operations) track and the next line is for the programming (service) track. The parameters are as follows:

MotorDriver(power_pin, signal_pin, signal_pin2, brake_pin, current_pin, senseFactor, tripMilliamps, faultPin)

Therefore, the second and third parameters are the signal pins. Some boards have 2 direction pins (e.g. IBT_2 Motor Driver Board). These are sometimes labelled CW and CCW for clockwise and counter-clockwise, or LPWM and RPWM for left and right pulse width modulation. If you want to use two pins, so that you don't need a transistor or integrated circuit inverter to take one output from the Command Station and split it into two, then you can't use the high accuracy waveform.

Therefore, the second and third parameters are the signal pins. Some boards have 2 direction pins (e.g. IBT_2 Motor Driver Board). These are sometimes labelled CW and CCW for clockwise and counter-clockwise, or LPWM and RPWM for left and right pulse width modulation. If you want to use two pins, so that you don’t need a transistor or integrated circuit inverter to take one output from the Command Station and split it into two, then you can’t use the high accuracy waveform.

If you have a board with a single DIR input, or wish to make the simple 1 transistor and 2 resistor inverter circuit shown below, you can use the high accuracy mode.

You must choose signal pins from the following list for your Arduino:

By luck, two of the Mega pins associated with Timer 1 are directly under the DIRA and DIRB pins of an Arduino Motor Driver; pins 12 and 13. Therefore, the combination of a Mega and this shield will automatically use high accuracy for both tracks.

However, an Uno's pins do not line up with this shield. In order to use high accuracy mode, you would have to change the signal pin assignments and use a jumper wire.

However, an Uno’s pins do not line up with this shield. In order to use high accuracy mode, you would have to change the signal pin assignments and use a jumper wire.

Some motor boards like the IBT_2 and Wingzine boards have two separate PWM inputs, usually labeled LPWM and RPWM for left and right PWM, or CW and CCW for clockwise and counter clockwise. The following circuit will take a single PWM signal from your Command Station, split it in two, and provide the inverted signal to the second PWM pin on 2 signal input motor drivers.

   :alt: Transistor inverter circuit

You will also have to make sure that you use a motor board definition that uses pin 11, 12, or 13 for the output signal on a Mega, or pin 9 or 10 for an Uno or Nano. For information about how to do this, see the section on :ref:`Creating a motor board definition <reference/hardware/motorboards/motor-board-config:If Your Board is in the Supported List>`.

You will also have to make sure that you use a motor board definition that uses pin 11, 12, or 13 for the output signal on a Mega, or pin 9 or 10 for an Uno or Nano. For information about how to do this, see the section on 

:ref:`Creating a motor board definition <reference/hardware/motorboards/motor-board-config:If Your Board is in the Supported List>`

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/429>`_

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/430>`_ - Give a link to how to handle the jumper reconfig

This board is electrically similar, though a different layout than the Arduino motor shield and does not have a brake_pin feature. Often cheaper. Supports 2A per channel, but can deliver realistically 1.3 or maybe 1.5 Amps with an added heatsink and cooling fan.

The YFROBOT Motor Shield will Only run DCC waveform and will Not be able to run DC waveform with the new TrackManager features as this shield does not have a brake_pin.

**Do NOT confuse this with the DFRobot Motor Shield, which is not plug and play!**

Do NOT confuse this with the DFRobot Motor Shield, which is not plug and play!

.. figure:: /_static/images/motorboards/yfrobot1.png
   :alt: YFRobot L298P Motor Driver Shield

   YFRobot L298P Motor Driver Shield

:doc:`Install the YFRobot Motor Shield (similar to Deek-Robot) </ex-commandstation/diy/assembly>`

**Remember to select YFROBOT_MOTOR_SHIELD in your config.h file or from the motor board dropdown if using EX-Installer**

Remember to select YFROBOT_MOTOR_SHIELD in your config.h file or from the motor board dropdown if using EX-Installer

This configuration uses the normal accuracy waveform to avoid having to use jumpers. To use the high-accuracy waveform, you would need to use pins 3 and 11 in your motor board definition in config.h and jumper them to D5 and D6 on the shield. For information about high-accuracy mode, See:

:ref:`High Accuracy Waveform <reference/hardware/motorboards/motor-board-config:Using High Accuracy Waveform Mode>`

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/430>`_

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/432>`_ - Update HC-12 wireless bridge page.

This page needs content, images, etc.

`LOW - Hardware <https://github.com/DCC-EX/dcc-ex.github.io/issues/432>`_

`MEDIUM - Diagnosing <https://github.com/DCC-EX/dcc-ex.github.io/issues/433>`_ - EX-CommandStation Software fails to load

An EX-CommandStation is a simple, but powerful, DCC Command Station which you assemble yourself using widely available Arduino boards. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

EX-CommandStation Command Station diagnosing Issues Troubleshooting

This page is intended to help you diagnose and fix some of the most common problems with the |EX-CS|.  If you have a more specific issue see the :doc:`ex-cs-troubleshooting` page.

This page is intended to help you diagnose and fix some of the most common problems with the 

Depending on how you have your EX-CommandStation configured, the steps to diagnose problems are different:

Have you selected the correct COM port? |BR| See :ref:`ex-installer/installing:getting ready` for information on finding the correct COM port.

(|Arduino IDE| only) |BR| Have you selected the correct Baud rate?

Your PC's firewall software may be stopping the installer from accessing the internet. Temporarily disable the firewall, or create an exception for EX-Installer. |BR| |BR| An internet connection is required to download some files.

Your PC’s firewall software may be stopping the installer from accessing the internet. Temporarily disable the firewall, or create an exception for EX-Installer. 

**If you have connected your EX-CommandStation to a PC via USB** (including for using |JMRI|).

**If you have connected your EX-CommandStation to a PC via USB**

As an initial check we recommend you should try to connect to your EX-CommandStation using |EX-WT|, even if you plan to use it via |JMRI| or a WiFi throttle.

As an initial check we recommend you should try to connect to your EX-CommandStation using 

|BR| For (b) or (c), try loading the EX-CommandStation software again.

 For (b) or (c), try loading the EX-CommandStation software again.

When you click the power on slider, it should say power on. |BR| Do the 4 LEDs on the motor board turn on and stay on?

Have you plugged in and turned on a 12-15v DC power supply into the motor board

Have you made sure the polarity of the power supply is correct.

|br| Do the 4 LEDs on the motor board turn on briefly, then turn off?

 Do the 4 LEDs on the motor board turn on briefly, then turn off?

When you select a loco and move the throttle, does the loco move?

loco is not DCC decoder equipped.  (You will likely hear a humming coming from the loco. If you do remove it from the track urgently, the loco may be being damaged.)

`MEDIUM - Diagnosing <https://github.com/DCC-EX/dcc-ex.github.io/issues/433>`_ - Using JMRI

`MEDIUM - Diagnosing <https://github.com/DCC-EX/dcc-ex.github.io/issues/433>`_

Have you selected 'DCC++' as the System Manufacturer and 'DCC++ Serial Port' as the System connection in the preferences?

Have you selected ‘DCC++’ as the System Manufacturer and ‘DCC++ Serial Port’ as the System connection in the preferences?

Select 'DCC++' as the System Manufacturer and 'DCC++ Serial Port' as the System connection in the preferences.

Select ‘DCC++’ as the System Manufacturer and ‘DCC++ Serial Port’ as the System connection in the preferences.

Check which com port the EX-CommandStation is connected to. |BR| See :ref:`ex-commandstation/installer-diy:1. getting ready` for details on how to determine the correct com port.

Can you turn the track power on?  |BR| Do the LEDs on the |motor shield| turn on?

When you open a throttle window in |JMRI|, select a loco and move the throttle, does the loco move?

Have you connected the track to the 'MAIN' outputs of the Motor Board.  |BR| |JMRI| cannot directly control trains on the 'PROGRAMMING' outputs without using additional commands. See :ref:`support/ex-cs-troubleshooting:cannot drive a locomotive` for more information.

Have you connected the track to the ‘MAIN’ outputs of the Motor Board.  

 cannot directly control trains on the ‘PROGRAMMING’ outputs without using additional commands. See 

loco is not DCC decoder equipped.  (You will likely hear a humming coming from the loco. If you do remove it from the track urgently, the loco is being damaged.)

**If you have configured your EX-CommandStation as an Access Point** (separate network)

**If you have configured your EX-CommandStation as an Access Point**

If you have configured your EX-CommandStation as an Access Point

You have not connected a 7-9v DC power supply to Arduino Board. |BR| *or* |BR|

You have not connected a 7-9v DC power supply to Arduino Board. 

You have not connected a USB cable connected to a power supply, to Arduino Board.

Can your phone see the WiFi network of the EX-CommandStation in the phone's available network list?

Can your phone see the WiFi network of the EX-CommandStation in the phone’s available network list?

WiFi shield is connected incorrectly to the CommandStation - The Rx pin of the WiFi shield must connect to the Tx pin on the CommandStation, and Tx to the Rx pin

The WiFi network name appears as "DCCEX-SAYS-BROKEN-FIRMWARE" or "UPDATE_ESP_FIRMWARE"

The WiFi network name appears as “DCCEX-SAYS-BROKEN-FIRMWARE” or “UPDATE_ESP_FIRMWARE”

Can your phone connect the WiFi network of the EX-CommandStation

Can your throttle app connect the WiThrottle server of the EX-CommandStation |BR| |BR| |Engine Driver| should show you the WiThrottle server in the discovered servers list |BR| For |WiThrottle| you will need to type in the IP address and Port

Can your throttle app connect the WiThrottle server of the EX-CommandStation 

 should show you the WiThrottle server in the discovered servers list 

When select a loco in the throttle app and move the throttle, does the loco move?

Have you connected the track to the 'MAIN' outputs of the Motor Board.  |BR| You cannot directly control trains on the 'PROGRAMMING' outputs without using additional commands which can be done in |Engine Driver| but not other WiFi throttle apps (Use the :guilabel:`Request Loco ID` button in |Engine Driver|.) |BR| recommend that the MAIN outputs be used to run a layout.

 You cannot directly control trains on the ‘PROGRAMMING’ outputs without using additional commands which can be done in 

**If you have configured your EX-CommandStation in Station mode (connected to your home WiFi network)**

If you have configured your EX-CommandStation in Station mode (connected to your home WiFi network)

You have not connected a USB cable connected to a power supply, to Arduino Board

Can your throttle app connect to the WiThrottle server of the EX-CommandStation |BR| |BR| |Engine Driver| should show you the WiThrottle server in the discovered servers list |BR| For |WiThrottle| It should connect automatically.

Can your throttle app connect to the WiThrottle server of the EX-CommandStation 

You may be on a different network to the EX-CommandStation (e.g. 2.5gHz VS 5gHz connection to you home router.) Try entering the IP address and Port manually.  To

`LOW - More FAQs to follow <https://github.com/DCC-EX/dcc-ex.github.io/issues/434>`_

This is a list of **Frequently Asked Questions** that we answer on our various support channels:

Yes, by issuing the command ``<1 JOIN>`` via the serial console.  |BR| This is intended to be temporary, for running a loco from a programming track onto your layout, not for normal running of the layout. |BR| |BR| (In |Engine driver| you can :guilabel:`Request Loco ID` which will also temporarily allow the loco to be driven from the programming track. see :doc:`/throttles/driveaway` for more information.)

 This is intended to be temporary, for running a loco from a programming track onto your layout, not for normal running of the layout. 

 which will also temporarily allow the loco to be driven from the programming track. see 

Being able to read an SD card on the Arduino platforms requires a significant amount of code because there is no operating system or file system which we would take for granted on a PC. We simply don’t have enough free memory on an Arduino to hold that code. |BR| |BR| See :ref:`exrail/about:why can't i put a script on an sdcard?` for more information.

Being able to read an SD card on the Arduino platforms requires a significant amount of code because there is no operating system or file system which we would take for granted on a PC. We simply don’t have enough free memory on an Arduino to hold that code. 

`Checking AT version with a USB to TTL CH340G Converter Module Adapter prior to upload`

Unfortunately, other than the recommended *DCC-EX EX-WiFiShield 8266* and *Makerfabs ESP8266 WiFi Shield*, the Espressif ESP8266 based WiFi Boards that are available for sale routinely come with versions of the firmware that simply do not work with |EX-CS|. There was a run of Makerfabs boards from around May 2023 through October 2023 that had defective firmware from Expressif. You can use this tutorial to upgrade one of those boards if you have one. All boards manufactured after November 2023 have the correct firmware. These boards carry the DCC-EX logo on the bottom and display version 1.1 or later.

, the Espressif ESP8266 based WiFi Boards that are available for sale routinely come with versions of the firmware that simply do not work with 

. There was a run of Makerfabs boards from around May 2023 through October 2023 that had defective firmware from Expressif. You can use this tutorial to upgrade one of those boards if you have one. All boards manufactured after November 2023 have the correct firmware. These boards carry the DCC-EX logo on the bottom and display version 1.1 or later.

:dcc-ex-text-size-200pct:`ONLY Version 1.7.4 is known to work reliably.`

That means all versions both before or after 1.7.4 are *not* suitable.  So don't be fooled in thinking that if it has a version later than that it will be ok.  **It won't!**

 suitable.  So don’t be fooled in thinking that if it has a version later than that it will be ok.  

There several common symptoms of a an incorrect firmware version:

If you set up the command station in |Access Point mode|, then the SSID (Network Name) the displayed will be "DCCEX_SAYS_BROKEN_FIRMWARE" or "UPDATE_ESP_FIRMWARE".

, then the SSID (Network Name) the displayed will be “DCCEX_SAYS_BROKEN_FIRMWARE” or “UPDATE_ESP_FIRMWARE”.

Your phone can connect to the Access Point, but can't connect your WiFi throttle (e.g. |Engine Driver| or |WiThrottle|) to the |EX-CS|.

Your phone can connect to the Access Point, but can’t connect your WiFi throttle (e.g. 

You can connect and use a phone once, but it will not connect again unless you re-start the |EX-CS|.

You can connect and use a phone once, but it will not connect again unless you re-start the 

You can connect and use one phone, but it will not allow connection of a second phone, or the second phone works, but it disconnects the first phone.

It is important to find out which version of the firmware you board has and correct it if necessary.

:ref:`AFTER you load the EX-CommandStation software <support/wifi-at-version:Checking AFTER you load the EX-CommandStation software>`

:ref:`BEFORE you load the EX-CommandStation software <support/wifi-at-version:Checking BEFORE you load the EX-CommandStation software>`

One you have loaded the |EX-CS| software you will be able to see the AT version in the start-up log by connecting the serial monitor in either the |EX-I| or **Arduino IDE** (whichever you used to upload the |EX-CS| onto your device).

 software you will be able to see the AT version in the start-up log by connecting the serial monitor in either the 

You can check the AT version two ways. Which is best for you depends on how you loaded the |EX-CS| software:

You can check the AT version two ways. Which is best for you depends on how you loaded the 

:ref:`Using EX-Installer <support/wifi-at-version:Checking the AT version using EX-Installer>`

:ref:`Using EX-WebThrottle <support/wifi-at-version:Checking the AT version using EX-WebThrottle>`

:ref:`Using the Arduino IDE <support/wifi-at-version:Checking the AT version with the Arduino IDE>`

Click back through the pages of the |EX-I| till you get to the 'Select your Device' screen

Click on the :guilabel:`View device monitor` button |BR| A new window will open and a lot of text will appear

You need to look for a line that will have a section highlighted in green

Alternately, you can enter the command ``<+GMR>`` and click :guilabel:`Send`.  A similar line will be shown.

If it says **anything other than** 1.7.4 in that line, then you have the wrong version you will need to :ref:`follow the instructions at the end of this page <support/wifi-at-version:What to do if you have the wrong AT Firmware version>` to correct it.

 1.7.4 in that line, then you have the wrong version you will need to 

:ref:`follow the instructions at the end of this page <support/wifi-at-version:What to do if you have the wrong AT Firmware version>`

Click the :guilabel:`Connect EX-CS` button and select the COM port that you used to load the software onto the |EX-CS|

 button and select the COM port that you used to load the software onto the 

If you loaded the |EX-CS| software using the Arduino, once you have successfully loaded the |EX-CS| software:

 software using the Arduino, once you have successfully loaded the 

A new pane will open at the bottom of the IDE window will open and a lot of text will appear

How to check before you load the |EX-CS| software will depend on which WiFi shield or board you are using:

 software will depend on which WiFi shield or board you are using:

:ref:`ESP-01 or ESP-01s <support/wifi-at-version:Checking the AT version of a ESP-01 or ESP-01s>`

:ref:`Makerfabs ESP8266 Wifi Shield <support/wifi-at-version:Checking the AT version of a Makerfabs ESP8266 Wifi Shield>`

:ref:`Duinopeak ESP8266 WiFi Expansion board <support/wifi-at-version:Checking the AT version of a Duinopeak ESP8266 WiFi Expansion Board>`

:ref:`Mega+WiF board <support/wifi-at-version:Checking the AT version of a Mega+WiFi>`

.. figure:: /_static/images/esp-01/esp-01.png
   :alt: ESP-01

   ESP-01

There are a number of ways that you can check the AT version an a ESP-01 or ESP-01s:

.. image:: /_static/images/esp-01/CH340G-USB-to-TTL(serial)-converter.png
   :class: image-float-right
   :alt: CH340G USB to TTL(serial) Converter

Connect the ESP01 to the serial adapter with the instructions on here: https://remotexy.com/en/help/esp8266-firmware-update |EXTERNAL-LINK| (see the section on 'Connection via the USB-UARt adapter') |BR| Note the orange wire is not needed for checking the AT version.

Connect the ESP01 to the serial adapter with the instructions on here: 

 Note the orange wire is not needed for checking the AT version.

It will reply with something like ``AT version:1.7.4.0(May 11 2020 19:13:04)``

.. image:: /_static/images/esp-01/USB-to-ESP-01-adapter-early.png
   :alt: Early ESP-01 USB adapter

.. image:: /_static/images/esp-01/USB-to-ESP-01-adapter.png
   :alt: ESP-01 USB adapter

.. image:: /_static/images/esp-01/USB-to-ESP-01s-adapter.png
   :alt: ESP-01s USB adapter

checking the at version of a esp-01 a with a usb to ttl ch340g converter module adapter

.. image:: /_static/images/wifi/makerfabs-esp8266-wifi-shield.png
   :alt: Makefabs ESP8266 WiFi Shield

.. image:: /_static/images/wifi/duinopeak.png
   :alt: Duinopeak ESP8266 WiFi Expansion Board

`Checking AT version ESP8266 WiFi Expansion Board prior to upload`

Checking AT version ESP8266 WiFi Expansion Board prior to upload

checking the at version of a duinopeak esp8266 wifi expansion board

.. image:: /_static/images/assembly/mega_wifi.png
   :alt: Mega + WiFi

The steps necessary to correct the AT version will depend on your hardware:

:ref:`ESP-01 or ESP-01s <support/wifi-at-version:Correcting the AT version on a ESP-01>`

:ref:`Makerfabs ESP8266 Wifi Shield <support/wifi-at-version:Correcting the AT version on a Makerfabs ESP8266 Wifi Shield>`

:ref:`Duinopeak ESP8266 WiFi Expansion board <support/wifi-at-version:Correcting the AT version on a Duinopeak ESP8266 WiFi Expansion Board>`

:ref:`Mega+WiF board <support/wifi-at-version:Correcting the AT version on a Mega+WiFi>`

We strongly recommend upgrading or downgrading to the "NonOS AT" version 1.7.4 available on our :doc:`/download/esp8266` download page **prior** to reaching out for support from the team.

We strongly recommend upgrading or downgrading to the “NonOS AT” version 1.7.4 available on our 

Correcting the AT version of a ESP-01or ESP01s requires additional hardware. One of following is required:

See https://remotexy.com/en/help/esp8266-firmware-update/ |EXTERNAL-LINK|

Correcting a ESP-01 or ESP-01s with a USB to TTL CH340G Converter Module Adapter

The early/normal boards needs to be modified to be able to temporarily connect GND to GPIO 0.

See here for the modification needed https://www.mogtour.com/wp-content/uploads/2021/01/ch340g.pdf |EXTERNAL-LINK|

See https://cordobo.com/2300-flash-esp8266-01-with-arduino-uno/ |EXTERNAL-LINK|

Or https://remotexy.com/en/help/esp8266-firmware-update/ |EXTERNAL-LINK|

There are **two** options for correcting the AT version on a Makerfabs ESP8266 Wifi Shield:

 options for correcting the AT version on a Makerfabs ESP8266 Wifi Shield:

Some people have experienced problems with v3.8.5 of the flash download tool (available from the DCC-EX Downloads) when following the instructions of the linked page. They have had more success with v2.3 (`available here <https://bbs.espressif.com/viewtopic.php?f=57&t=433>`_ |EXTERNAL-LINK| or `here <https://l.facebook.com/l.php?u=https%3A%2F%2Fwww.14core.com%2Fwp-content%2Fuploads%2F2015%2F11%2FFLASH_DOWNLOAD_TOOLS_v2.4_150924.rar%3Ffbclid%3DIwAR0fbvEFz8kDSJA2gTxfoELxjCpgJ4gLrUMIVEAAT7-ZijUz-zuw2u_IEJA&h=AT3orFt4zGDT6TJWu5vN8gZR0KZFSn4hRPNNlBdQKeKx1LjnKgFjnu9JoOstmKL7q90ov6R72eVhyEwr1Y_ihZHSSB-QH1uWg4WNtooVT410DOxdcDxu-ULhKLdj6BWlEuyJ&__tn__=R]-R&c[0]=AT0mJaTY7Uijw9oHkwCS233Z0qIwndZX4AYG3yer1G5pY4U9f9osL8pTpec-sKJbToYfoS3uqUEKouusXV1zj8Kidqz8fH2PgtWFNWo0UeXthti6kuASi3JyJftjnOACvcXV6PF1YAZW_3xKKmLERyurXizuFx7V>`_ |EXTERNAL-LINK|.)

If you don't succeed after several attempts with v3.8.5 try v2.3 instead.

Some people have experienced problems with v3.8.5 of the flash download tool (available from the DCC-EX Downloads) when following the instructions of the linked page. They have had more success with v2.3 (

`available here <https://bbs.espressif.com/viewtopic.php?f=57&t=433>`_

If you don’t succeed after several attempts with v3.8.5 try v2.3 instead.

Also see a detailed video by Andrew from `Wotton Tor <https://www.youtube.com/@AndrewH561>`_ |EXTERNAL-LINK| - `Flashing the Makerfabs wifi board <https://www.youtube.com/watch?v=mNHlDmCnPMU>`_ |EXTERNAL-LINK| (The flashing demo starts about 9 minutes into the video.)

`Flashing the Makerfabs wifi board <https://www.youtube.com/watch?v=mNHlDmCnPMU>`_

correcting the makerfabs esp8266 wifi shield with a usb to ttl converter module adapter

The instructions on the following page have been proven to work on Linux PCs, so will probably work on macOS PCs (Apple), however attempts to get them to work on **Microsoft Windows PCs** :dcc-ex-red-bold:`have so far been unsuccessful`. We need to do more testing. If you have an issue with this method, simply purchase a USB to TTL converter module and use the recommended process in the previous heading. This should not be an issue for most people since they will have the DCC-EX EX-WiFi Shield 8266 which has the correct firmware and a much easier upgrade process should that be required in the future.

The instructions on the following page have been proven to work on Linux PCs, so will probably work on macOS PCs (Apple), however attempts to get them to work on 

. We need to do more testing. If you have an issue with this method, simply purchase a USB to TTL converter module and use the recommended process in the previous heading. This should not be an issue for most people since they will have the DCC-EX EX-WiFi Shield 8266 which has the correct firmware and a much easier upgrade process should that be required in the future.

Flashing the ESP8266 WiFi Shield :doc:`using an Arduino Mega is covered here </support/makerfabs-update-at-version-with-mega>`.

:doc:`using an Arduino Mega is covered here </support/makerfabs-update-at-version-with-mega>`

correcting the makerfabs esp8266 wifi shield with an arduino mega

correcting the at version on a duinopeak esp8266 wifi expansion board

Flashing the ESP8266 chip on a Mega+WiFi is covered in detail :doc:`here </reference/hardware/microcontrollers/wifi-mega>`.

Checking AT version with a USB to TTL CH340G Converter Module Adapter prior to upload

`LOW - Software <https://github.com/DCC-EX/dcc-ex.github.io/issues/436>`_ - Give some setup tutorial here. Need a video to match since ED is the top used software

.. image:: /_static/images/throttles/icon_android.png
   :alt: Android Logo

.. image:: /_static/images/throttles/engine_driver_logo.png

**Engine Driver** (ED) is an Android App that uses the |WiThrottle Protocol| *or* the |DCC-EX Native Commands| to connect directly to the |EX-CS| via WiFi. It can also connect to the JMRI WiThrottle Server via WiFi using the |WiThrottle Protocol|.

 via WiFi. It can also connect to the JMRI WiThrottle Server via WiFi using the 

If you wish to connect Engine Driver directly to |EX-CS|, you need to add a WiFi option to your |EX-CS| as explained here: :doc:`WiFi Setup </ex-commandstation/diy/wifi-setup>`.

If you wish to connect Engine Driver to |JMRI|, you need to start the |WiThrottle Server| and (optionally [#]_) the Web Server in JMRI on the computer running |JMRI|. The |JMRI| computer must be connected to the |EX-CS| using a USB cable.

`Get 'Engine Driver Throttle' from the Google Play Store <https://play.google.com/store/apps/details?id=jmri.enginedriver>`_ |EXTERNAL-LINK|

`Get 'Engine Driver Throttle' from the Google Play Store <https://play.google.com/store/apps/details?id=jmri.enginedriver>`_

Visit the Engine Driver Website: `https://enginedriver.mstevetodd.com/ <https://enginedriver.mstevetodd.com/>`_ |EXTERNAL-LINK| for more information.

Extensive help is available at the `Engine Driver Home <https://flash62au.github.io/EngineDriver_Home/index.html>`_ |EXTERNAL-LINK| site.

`Engine Driver Home <https://flash62au.github.io/EngineDriver_Home/index.html>`_

.. raw:: html

   <iframe width="336" height="189" src="https://www.youtube.com/embed/N6TWR7fIl0A" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<iframe width="336" height="189" src="https://www.youtube.com/embed/N6TWR7fIl0A" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Control layout power, turnouts, routes, and access JMRI web panels and windows

'Discover Server' Detect, Select & Connect to WiFi enabled Command Stations

‘Discover Server’ Detect, Select & Connect to WiFi enabled Command Stations

'Roster Server' download Engine ID's & function keys from the Command Station

‘Roster Server’ download Engine ID’s & function keys from the Command Station

'Virtual Engine Sounds' {Bell, Horn, Short Horn, Mute} for motor only decoders, on first two throttles

‘Virtual Engine Sounds’ {Bell, Horn, Short Horn, Mute} for motor only decoders, on first two throttles

DCC-EX EXRAIL Automation {Handoff}, Route {Set} and EXRAIL Command function buttons

New 'Request Loco ID' & 'Drive Away' feature from a Program track onto Mainline track with |EX-CS|

New ‘Request Loco ID’ & ‘Drive Away’ feature from a Program track onto Mainline track with 

TrackManager control - able to change the type and state of each Track/Channel (e.g DCC and DC))

ex-commandstation specific features - when using the dcc-ex native protocol

.. image:: /_static/images/throttles/ed1.png
   :alt: Engine Driver Main Screen

.. image:: /_static/images/throttles/ed2.png
   :alt: Engine Driver 2

.. image:: /_static/images/throttles/ed3.png
   :alt: Engine Driver 3

.. image:: /_static/images/throttles/ed4.png
   :alt: Engine Driver 4

and https://enginedriver.mstevetodd.com/videos/index.html |EXTERNAL-LINK|

This is the one Steve Todd uses himself on a lanyard. It leaves both hands free for paperwork and uncoupling and is light enough to simply let go of when you need both hands. Here are his optimised settings. His preferred settings are listed in the note below. You can use these as a start and customise them for your own use:

.. image:: /_static/images/throttles/bt_controller1.jpg
   :alt: Bluetooth Lanyard Controller

`Wireless Bluetooth Gamepad/Joystick Controller <https://www.amazon.com/Wireless-Gamepad-Bluetooth-Controller-Shutter/dp/B07WFH2HB9>`_ |EXTERNAL-LINK|

`Wireless Bluetooth Gamepad/Joystick Controller <https://www.amazon.com/Wireless-Gamepad-Bluetooth-Controller-Shutter/dp/B07WFH2HB9>`_

And here is another Bluetooth controller that provides extra function buttons and you can hold by placing your finger in the ring.

.. image:: /_static/images/throttles/bt_controller2.jpg
   :alt: Ring Shape Hand Controller

From Steve: I set speedsteps to 10, change amount to 1, repeat delay to 9999, horizontal switching layout, throttle web view. I acquire loco/consist using my phone, then dim & lock and put phone in my holster. Then I can "bump" the joystick up and down 3,2,1,0,-1,-2,-3, easily keeping track of the current "notch". 1 is coupling speed, 2 is switching/yard speed, 3 is mainline. If I'm at home, I put the Conductor view in the web and I have my work for each location.

From Steve: I set speedsteps to 10, change amount to 1, repeat delay to 9999, horizontal switching layout, throttle web view. I acquire loco/consist using my phone, then dim & lock and put phone in my holster. Then I can “bump” the joystick up and down 3,2,1,0,-1,-2,-3, easily keeping track of the current “notch”. 1 is coupling speed, 2 is switching/yard speed, 3 is mainline. If I’m at home, I put the Conductor view in the web and I have my work for each location.

.. image:: /_static/images/throttles/ed_conductor_view1.png
   :alt: Engine Driver Conductor View
   :scale: 15%

It is possible to easily add a rotary dial (knob) to |Engine Driver|.  see :doc:`/throttles/hardware/engine-driver-physical-knobs` for more information.

If you are having difficulties with Engine Driver connecting to an |EX-CS| it is very helpful if you can provide the support team with a log file of when the problem occurs.

If you are having difficulties with Engine Driver connecting to an 

 it is very helpful if you can provide the support team with a log file of when the problem occurs.

In some versions of Android you may also need to change the connection type on the phone from 'charging' to 'file transfer'

In some versions of Android you may also need to change the connection type on the phone from ‘charging’ to ‘file transfer’

Browse down to the folder ``...\Internal shared storage\Android\data\jmri.enginedriver\files``

``...\Internal shared storage\Android\data\jmri.enginedriver\files``

...\Internal shared storage\Android\data\jmri.enginedriver\files

Find the most resent file that looks like ``logcatxxxxxxxxxxxxx.txt``     e.g. logcat1699833098998.txt

Attach that file to a message here in discord using the paperclip button on the toolbar above the message content

the Web server is required if you want to show the Loco images in Engine Driver.

The |WiThrottle Protocol| is the proprietary protocol developed by Brett Hoffman at https://www.WiThrottle.com |EXTERNAL-LINK|

`LOW - Software <https://github.com/DCC-EX/dcc-ex.github.io/issues/436>`_

 - Give some setup tutorial here. Need a video to match since ED is the top used software

TrackManager is a capability of EX-CommandStation which allows you to control both DC and/or DCC locomotives. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

|SUITABLE| |tinkerer| |engineer| |support-button| |githublink-ex-commandstation-button-small|

|EX-CS| is now a dual **Command Station** for both **Digital Command Control (DCC)** and **analogue (DC)** layouts.

With just a single |EX-CS| and a compatible throttle you can simultaneously run both your DCC Locos and analogue DC Locos with road number IDs as throttle addresses from 1 to 10239 to control and drive them on multiple separate insulated tracks/districts.

 and a compatible throttle you can simultaneously run both your DCC Locos and analogue DC Locos with road number IDs as throttle addresses from 1 to 10239 to control and drive them on multiple separate insulated tracks/districts.

By default the outputs of a Motor Driver are set to DCC. For Motor Drivers with two outputs one will be MAIN and one will be PROG.  These, and any additional outputs, can be set to a number of different modes, not just DCC.

* :ref:`DCC modes <trackmanager/index:changing a motor driver output to a different dcc mode>`

  * MAIN
  * MAIN_INV
  * MAIN_AUTO [#TM2]_
  * PROG
  * NONE

* :ref:`DC modes <trackmanager/index:changing a motor driver output to dc>`

  * DC
  * DC_INV [#tm1]_ [#TM3]_
  * DCX [#tm1]_
  * NONE

:ref:`DCC modes <trackmanager/index:changing a motor driver output to a different dcc mode>`

* MAIN
* MAIN_INV
* MAIN_AUTO [#TM2]_
* PROG
* NONE

:ref:`DC modes <trackmanager/index:changing a motor driver output to dc>`

* DC
* DC_INV [#tm1]_ [#TM3]_
* DCX [#tm1]_
* NONE

DC_INV / DCX is DC with an opposite polarity. Like NMRA modular layout track B which is wired left rail positive (+) and right rail negative (-)

Deprecated alias of ``AUTO`` but only when preceeded by a sperate ``MAIN`` command.

Whenever the track mode is changed, track power is automatically turned off.  This is a safety precaution to prevent runaway locos.

A |motor shield| with a brake pin. |BR| (See the list of compatible boards at :ref:`reference/hardware/motor-boards:trackmanager dc compatible boards`.) |BR| (The |EX-CSB1-SHORT| and |EX-MS| have a brake pin.)

:ref:`reference/hardware/motor-boards:trackmanager dc compatible boards`

*No additional external DCC decoders are required for DC (PWM) track assignments, and a single* |EX-CS| *is the only hardware needed for full functionality.*

*No additional external DCC decoders are required for DC (PWM) track assignments, and a single*

No additional external DCC decoders are required for DC (PWM) track assignments, and a single

Note: An additional suggested precaution is to add 4 fuses on wires (-b +b, -a +a) to the |EX-CS| connections. Use 2A fuses for the |standard motor driver| or 5A fuses for the |EX-MS| and other the larger motor drivers.

Note: An additional suggested precaution is to add 4 fuses on wires (-b +b, -a +a) to the 

If you are interested in the technical details of DC Pulse Width Modulation (PWM) visit our :doc:`/reference/hardware/dcc-vs-dc` page.

If you are interested in the technical details of DC Pulse Width Modulation (PWM) visit our 

You can change any output of the Motor Driver either temporarily or permanently (every time the |EX-CS| starts).

You can change any output of the Motor Driver either temporarily or permanently (every time the 

There are several ways to temporarily change a Motor Driver Output to a different DCC Mode:

By creating |EX-R| Routes that can the activated in your throttle app.

You can issue |DCC-EX Native Commands| to the |EX-CS| to change the output modes with |Engine Driver|, |EX-TB|, |Device Monitor|, |EX-WT| or the |IDE Serial Monitor|.

Open the |Serial Monitor| (or TrackManager page in |Engine Driver| or |Ex-TB|)

Issue the following command. |BR| Note that in this example I am setting output B to be DCC MAIN.

 Note that in this example I am setting output B to be DCC MAIN.

Note the track power is immediately turn off anytime you change the track mode.

Using a Route will set a specific loco number to be associated with DC output. This is a permanent relationship, in that it will be associated every time you start the |EX-CS|.

Using a Route will set a specific loco number to be associated with DC output. This is a permanent relationship, in that it will be associated every time you start the 

We will be adding some instructions the ``myAutomation.h`` file a re-uploading the Command Station software your |EX-CS|.

Re-run the |EX-I| selecting the options you would normally choose, but of the last page before loading you also select ``Advanced Config``, before clicking the :guilabel:`Advanced Config` button.

 selecting the options you would normally choose, but of the last page before loading you also select 

This will take you to the ``Advanced Configuration`` page, where you will have two (or possibly more) edit regions. One will be labelled ``myAutomation.h``.

 page, where you will have two (or possibly more) edit regions. One will be labelled 

in the ``myAutomation.h`` edit region you will need to type or copy the something like the following. |BR| Note that in this example I am setting output B to be DCC MAIN.

 edit region you will need to type or copy the something like the following. 

ROUTE(3, "Set Output B to DCC MAIN") // 3 is the sequence identifier  it must be unique
  SET_TRACK(B,MAIN)  // Set Track B to DCC MAIN
  DONE

Then Load the Command Station software as normal (on the next page)

Note the track power is immediately turn off anytime you change the track mode. you may wish to add ``SET_POWER( track, ON/OFF )`` after the ``SET_TRACK()`` command. e.g. ``SET_POWER(B ON)``.

Note the track power is immediately turn off anytime you change the track mode. you may wish to add 

By default the outputs of a Motor Driver are set to DCC. For Motor Drivers with two outputs one will be ``MAIN`` and one will be ``PROG``.  These, and any additional outputs, can be set to a number of different modes, not just DCC.

By default the outputs of a Motor Driver are set to DCC. For Motor Drivers with two outputs one will be 

.  These, and any additional outputs, can be set to a number of different modes, not just DCC.

You can set any Motor Driver output to be a specific DCC mode every time the |EX-CS| starts up. (If you wish, at any time you can subsequently temporarily change it any other DC or DCC mode.)

You can set any Motor Driver output to be a specific DCC mode every time the 

 starts up. (If you wish, at any time you can subsequently temporarily change it any other DC or DCC mode.)

This process is similar to a the 'Route' process in the previous section but will happen automatically at start-up rather than when you select the route.

This process is similar to a the ‘Route’ process in the previous section but will happen automatically at start-up rather than when you select the route.

AUTOSTART
  DONE

Whenever the track mode is changed, track power is automatically turned off.

It is important to note a key difference between controlling a DCC loco on a DCC output/track, and controlling a DC loco on a DC output/track.

In the case on DCC, you select the individual DCC address of the loco and you control just that loco regardless of how many other DCC locos are on the track.

If you plan to also use DCC, when specifying a DC address, avoid using one of your existing loco DCC addresses.

Otherwise a command sent to control a DC output/track will also operate your DCC loco with the same address.

In the case of DC it is very different. You control the whole output/track and all the locos on it simultaneously.  *To do so we must assign that output/track an address.*  It is not a real DCC Address, but from the perspective of your controller, it will think it is a DCC Address.

In the case of DC it is very different. You control the whole output/track and all the locos on it simultaneously.  

  It is not a real DCC Address, but from the perspective of your controller, it will think it is a DCC Address.

When you read further just remember that the address assigned DC output/track is not really the loco.  *It is an address for the output/track.*

When you read further just remember that the address assigned DC output/track is not really the loco.  

There are several ways to temporarily change a Motor Driver Output to DC:

By creating |EX-R| Routes or Automations that can the activated in your throttle app.

 Routes or Automations that can the activated in your throttle app.

|Engine Driver| has specific TrackManager features that allow you to alter the output modes.  See the :ref:`throttles/software/engine-driver-native-protocol:trackmanager control` Engine Driver page for details.

 has specific TrackManager features that allow you to alter the output modes.  See the 

|EX-TB| has specific TrackManager features that allow you to alter the output modes. See the :ref:`ex-toolbox/using:track manager` page for details.

 has specific TrackManager features that allow you to alter the output modes. See the 

Issue the following command |BR| note that in this example I am setting output B to be DC and to be assigned to the Loco Address 1225.

 note that in this example I am setting output B to be DC and to be assigned to the Loco Address 1225.

Firstly you will need to select an address (1-10239) which will be assigned to the DC output.  If you are also using using DCC on another output, pick a number that will not conflict with any of your own loco's addresses.

Firstly you will need to select an address (1-10239) which will be assigned to the DC output.  If you are also using using DCC on another output, pick a number that will not conflict with any of your own loco’s addresses.

Next re-run the |EX-I| selecting the options you would normally choose, but of the last page before loading you also select ``Advanced Config``, before clicking the :guilabel:`Advanced Config` button.

in the ``myAutomation.h`` edit region you will need to type or copy the something like the following |BR| note that in this example I am setting output B to be DC and to be assigned to the Loco Address 1225.

 edit region you will need to type or copy the something like the following 

ROUTE(1, "Set Output B to DC 1225") // 1 is the sequence identifier  it must be unique
  SETLOCO(1225)    // Assign Loco 1225
  SET_TRACK(B,DC)  // Set Track B to DC with address 1225
  DONE

Note that this will make the output DC if you activate the route in you controller.  See :ref:`trackmanager/index:controlling a dc loco` for more information.

Note that this will make the output DC if you activate the route in you controller.  See 

Using an Automation rather than a Route creates a temporary association between a loco address and the DC output.  It takes whatever address you currently have selected in the controller and assigns that to the output.

AUTOMATION(2, "Set Output B to DC") // 2 is the sequence identifier  it must be unique
  SET_TRACK(B,DC)  // Set Track B to DC
  DONE

You can set any Motor Driver output to be DC every time the |EX-CS| starts up. (If you wish, at any time you can subsequently temporarily change it any other DC or DCC mode.)

in the ``myAutomation.h`` edit region you will need to type or copy the something like the following |BR| note that in this example I am setting output to be DC an to be assigned to the Loco Address 1225.

 note that in this example I am setting output to be DC an to be assigned to the Loco Address 1225.

AUTOSTART
  DONE

Remember that the address you assigned DC output/track above is not really the loco.  *It is an address for the output/track.*

Remember that the address you assigned DC output/track above is not really the loco.  

While the process to control a loco is exactly the same as a DCC loco, the process to select it will vary depending on *how* you configured the Motor Driver Output to be DC.

While the process to control a loco is exactly the same as a DCC loco, the process to select it will vary depending on 

You will need to select the Loco Address you assigned to the output when you setup the permanent assignment.

You will then need to select the Loco Address you assigned to the output when you created the route.

You will then need to select any Loco Address that you wish to use

You will need to select the Loco Address you assigned to the output to DC.

Any throttle that connect to an |EX-CS| can control analogue (DC) locos just as easily as DCC locos. Throttle Compatibility:

 can control analogue (DC) locos just as easily as DCC locos. Throttle Compatibility:

* WiFi Throttles (e.g. |Engine Driver|, |wiThrottle| and many others)
* The DCC-EX browser based |EX-WT|
* Other wired throttles to operate your DCC layout and your DC layout, either separately or a simultaneous combination of the two modes

WiFi Throttles (e.g. |Engine Driver|, |wiThrottle| and many others)

Other wired throttles to operate your DCC layout and your DC layout, either separately or a simultaneous combination of the two modes

Never drive a loco, DC or DCC, from an |EX-CS| controlled track or district to any other DCC or DC *System*.

**Frequency of PWM in DC Operation** - PWM can use a variety of frequencies for the pulses it sends, and this can alter motor behaviour and noise etc.

 - PWM can use a variety of frequencies for the pulses it sends, and this can alter motor behaviour and noise etc.

The default frequency used for the |EX-CSB1-SHORT| is 131H, but this can be varied on-the-fly using the virtual DCC functions 29-31 to allow you to alter the frequency to better suit your loco's motor. This can of course be done during running from the throttle.

 is 131H, but this can be varied on-the-fly using the virtual DCC functions 29-31 to allow you to alter the frequency to better suit your loco’s motor. This can of course be done during running from the throttle.

Just acquire the loco number you have assigned to your DC Output. Then select one of Functions 29, 30 or 31:

These functions are not cumulative - setting F30 overrides F29 and setting F31 overrides F29 & F30.

You need to activate the functions above once you have acquired the loco address that have assigned to the output. |BR|  Specifically:

1) Set the output/track to DC mode with a specified loco address
2) Acquire that loco address in your throttle app
3) Make sure the loco is stopped
4) Set the frequency by activating one of the functions above

You need to activate the functions above once you have acquired the loco address that have assigned to the output. 

You need to stop the loco (throttle to zero) before changing the frequency using the function buttons.

If you plan to use multiple |DC| and/or |DCC| blocks, these should not be using a common ground rail, and only use dual insulated tracks.

 blocks, these should not be using a common ground rail, and only use dual insulated tracks.

Existing analogue DC layouts will have standard DC controllers/transformers on one or more separate DC tracks/districts/blocks.

If you have more than one controller, they may have DPDT centre-off switches between two controller powered blocks.

You will be replacing this kind of legacy analogue DC described above with a single |EX-CS|. It includes a software switching implementation, allowing you to easily and quickly switch between the two |DCC| and |DC PWM| modes on any of the A thru H dual insulated tracks/districts in real time.

You will be replacing this kind of legacy analogue DC described above with a single 

. It includes a software switching implementation, allowing you to easily and quickly switch between the two 

 modes on any of the A thru H dual insulated tracks/districts in real time.

This also means that, if you wish, you can remove any physical hardware DPDT switches that were used to switch between standard DC controllers/transformers.

This is all done through a single |EX-CS|. And no we're not using another Expensive DCC decoder under the table on each Track/District/Block to address that section of track. The capability is built into the |EX-CS|.

. And no we’re not using another Expensive DCC decoder under the table on each Track/District/Block to address that section of track. The capability is built into the 

Below is an example of a very simple DC layout with two DC controllers/transformers, with one for each track.

.. figure:: /_static/images/layouts/dc-layout-1.png
  :alt: DC Layout - 2 Blocks

  DC Layout - 2 Blocks - DC controllers/transformers

With an |EX-CS| with both outputs set to |DC PWM|, the wiring for the same layout is a very simple swap.

.. figure:: /_static/images/layouts/dc-layout-2.png

  DC Layout - 2 Blocks - EX-CSB1

The ready-to-run |EX-CSB1-SHORT| and the do-it-yourself |EX-CS| default to |DCC| on both outputs!

You must use the instructions above before placing a DC loco on the track, or you may risk damaging the loco.

TODO XXX see if there is anything else in these two paragraphs that that should be retained

Existing analogue DC layouts which have standard DC transformers on two or more separate DC tracks/districts/blocks and/or also have a second separate proprietary DCC command station would have in place a section of dead rail, an electric relay, or a DPDT centre-off switch between the two types of controller powered stations. These should not be using a common ground rail, and only use dual insulated tracks.

You will be replacing this kind of legacy analogue DC and proprietary DCC installation described above with a single |EX-CS| which will have a software switching implementation, allowing you to easily and quickly swap between the two DCC (PWM) and DC (PWM) modes on any of the A thru H dual insulated tracks/districts in real time.

Below is a more detailed and technical discussion of the topics above.

Using |TM| with simple easy commands from a throttle or from a |serial monitor| we can change any insulated track A-H from DCC (PWM) to DC (PWM) and back in real time.

 we can change any insulated track A-H from DCC (PWM) to DC (PWM) and back in real time.

* Valid DCC modes are ``MAIN``, ``MAIN_INV``, ``MAIN_AUTO``, ``PROG``, and ``NONE``
* Valid DC modes are ``DC``, ``DC_INV`` / ``DCX``, and ``NONE``

Valid DCC modes are ``MAIN``, ``MAIN_INV``, ``MAIN_AUTO``, ``PROG``, and ``NONE``

DC_INV / DCX is DC with an opposite polarity like NMRA modular layout track B which is wired left rail positive (+) and right rail negative (-)

This allows a throttle on track B set to DC_INV / DCX to operate in forward and reverse correctly for west bound engines

So, you can take a standard DC motor only loco's road number on the side of the loco and assign it to one or more of up to 8 tracks/districts/blocks labelled A thru H. Then enter that same number into a throttle and control that Address on each and every one of the assigned tracks.

So, you can take a standard DC motor only loco’s road number on the side of the loco and assign it to one or more of up to 8 tracks/districts/blocks labelled A thru H. Then enter that same number into a throttle and control that Address on each and every one of the assigned tracks.

* Valid Cab addresses are 1 to 10239.
* Invalid Cab address is 0 zero.

We do not support Zero stretching / zero stretch address function, found on Digitrax and Lenz command Stations. See the ':ref:`reference/hardware/dcc-vs-dc:this is not zero stretching`' section for more information.

We do not support Zero stretching / zero stretch address function, found on Digitrax and Lenz command Stations. See the ‘

Place any analogue DC loco/engine on a TrackManager DC assigned track with our |EX-CS| and it sits there dead quiet with lights off. When the throttle speed is increased in either direction and then lights up and begins to move.

Place any analogue DC loco/engine on a TrackManager DC assigned track with our 

 and it sits there dead quiet with lights off. When the throttle speed is increased in either direction and then lights up and begins to move.

A DCC Loco with a DC enabled sound decoder also sits quietly and when the throttle increases the sound will turn on first then as you throttle up more it will begin moving.  You can throttle back until it stops but leave a little throttle speed on say 5% and the Sound will continue to play while it is stopped.

Throttle speed response for DC locos vary because the DCdistrict track is operating from 0Vdc to 16+Vdc ~PWM waveform signal. Locos operating on a DCdistrict with either WiFi Throttles and |EX-R| Automation scripts with |Engine Driver| Handoff run different DC motors at different speeds.

Throttle speed response for DC locos vary because the DCdistrict track is operating from 0Vdc to 16+Vdc ~PWM waveform signal. Locos operating on a DCdistrict with either WiFi Throttles and 

So a script for FWD(50) speed will run at completely different speeds for two different DC motors depending on their resistance and efficiency.  One crawls at 50 while the other one runs like a bat out of hell.

You can also run a DCC locos with DC Conversion CV enabled On and run on the DCdistrict, without having to change the decoder DCC address.

DCC Sound Decoder locos with DC conversion enabled may be silent until the track reaches between 2v to 6Vdc then the Sound will start up, and between 3v to 8Vdc the motor will begin to respond and move depending on the manufacturer's decoder.

DCC Sound Decoder locos with DC conversion enabled may be silent until the track reaches between 2v to 6Vdc then the Sound will start up, and between 3v to 8Vdc the motor will begin to respond and move depending on the manufacturer’s decoder.

You can Assign Tracks/Districts to |DCC| and |DC| mode in four ways:

1. Command Line via PC with |IDE Serial Monitor| or |JMRI| serial Traffic Monitor and it is sent through your USB connected cable.
2. Create an |EX-R| myAutomation.h file Scripts for Track Manager assigned commands and they automatically appear in |Engine Driver| as GUI Automation [Handoff] and Route [Set] buttons, and in WiThrottle WiFi Throttle iOS as [Route] buttons, and on TCS Universal UWT-50 & 100 WiFi Throttle [Select Accry] lines.

3. Enhanced |Engine Driver| WiFi Throttle Android app v2.35.169+ features;

  * Track/District Manager set mode screen by touching a track mode entering an address
  * Command Cmd Line |Serial Monitor| and enter them like in example (1) above but via WiFi Native mode

4. New |EX-TB| WiFi Android app features;

  * Track/District Manager set mode screen by touching a track mode, entering an address

Command Line via PC with |IDE Serial Monitor| or |JMRI| serial Traffic Monitor and it is sent through your USB connected cable.

 serial Traffic Monitor and it is sent through your USB connected cable.

Create an |EX-R| myAutomation.h file Scripts for Track Manager assigned commands and they automatically appear in |Engine Driver| as GUI Automation [Handoff] and Route [Set] buttons, and in WiThrottle WiFi Throttle iOS as [Route] buttons, and on TCS Universal UWT-50 & 100 WiFi Throttle [Select Accry] lines.

 myAutomation.h file Scripts for Track Manager assigned commands and they automatically appear in 

 as GUI Automation [Handoff] and Route [Set] buttons, and in WiThrottle WiFi Throttle iOS as [Route] buttons, and on TCS Universal UWT-50 & 100 WiFi Throttle [Select Accry] lines.

Enhanced |Engine Driver| WiFi Throttle Android app v2.35.169+ features;

* Track/District Manager set mode screen by touching a track mode entering an address
* Command Cmd Line |Serial Monitor| and enter them like in example (1) above but via WiFi Native mode

Track/District Manager set mode screen by touching a track mode entering an address

Command Cmd Line |Serial Monitor| and enter them like in example (1) above but via WiFi Native mode

 and enter them like in example (1) above but via WiFi Native mode

* Track/District Manager set mode screen by touching a track mode, entering an address

Track/District Manager set mode screen by touching a track mode, entering an address

New |Engine Driver| DCC-EX Native mode features now available today via Google Play Store:

 DCC-EX Native mode features now available today via Google Play Store:

* `Engine Driver <https://play.google.com/store/apps/details?id=jmri.enginedriver>`_
* `EX-Toolbox <https://play.google.com/store/apps/details?id=dcc_ex.ex_toolbox>`_

`EX-Toolbox <https://play.google.com/store/apps/details?id=dcc_ex.ex_toolbox>`_

Sending commands from the |IDE Serial Monitor| or |JMRI| Send Command Line or a |Engine Driver| WiFi Throttle.

To display the current TrackManager configuration, use the command ``<=>`` an equal sign looks like a track.

To display the current TrackManager configuration, use the command 

The |Serial Monitor| will show current status, example; Track A as Main and Track B as PROG

 will show current status, example; Track A as Main and Track B as PROG

To change or configure the current track modes use the new command ``<= trackletter mode [address]>`` which has been added for Track Manager, where:

To change or configure the current track modes use the new command 

* ``trackletter`` is A through H
* ``mode`` is one of MAIN, MAIN_INV, MAIN_AUTO, PROG, DC, DC_INV / DCX, or NONE (DCX is DC with opposite polarity)
* ``address`` is the Cab/Loco ID and is only required when specifying DC or DC_INV / DCX modes

``mode`` is one of MAIN, MAIN_INV, MAIN_AUTO, PROG, DC, DC_INV / DCX, or NONE (DCX is DC with opposite polarity)

 is one of MAIN, MAIN_INV, MAIN_AUTO, PROG, DC, DC_INV / DCX, or NONE (DCX is DC with opposite polarity)

``address`` is the Cab/Loco ID and is only required when specifying DC or DC_INV / DCX modes

 is the Cab/Loco ID and is only required when specifying DC or DC_INV / DCX modes

 <= A MAIN>     // Set track A to MAIN DCC mode
 <= B PROG>     // Set track B to PROG DCC mode
or
 <= A DC 1234>  // Set track A to DC mode with address 1234
 <= B DCX 4321> // Set track B to DC mode Opposite Polarity address 4321
                // or any number you assign from 1 to 10239
 <= B NONE>      // Set track B disabled, like a staging yard when it gets too noisy.

You would then enter your Engine address on the throttle of 1234 and 4321 and drive them on the layout.

Using |EX-R| functions inside myAutomation.h file to run Automation scripts to change track modes from DCC to DC and back.
my.Automation.h file

 functions inside myAutomation.h file to run Automation scripts to change track modes from DCC to DC and back.

//SET_TRACK(id,mode)
  SET_TRACK(C, DC)
  SET_TRACK(D, DCX)

Note that the Address to be used for a DC or DC_INV / DCX block must be set before the ``SET_TRACK`` command e.g.

Note that the Address to be used for a DC or DC_INV / DCX block must be set before the 

In a |EX-R| Automation script we could assign a track mode to DC and wait for a |Engine Driver| to Assign the Current Selected Active Engine Address and drive Manually through the district on the layout.

 Automation script we could assign a track mode to DC and wait for a 

 to Assign the Current Selected Active Engine Address and drive Manually through the district on the layout.

See the third Engine Driver Throttle image 'Districts A thru B with [Set] buttons at the end.

See the third Engine Driver Throttle image ‘Districts A thru B with [Set] buttons at the end.

AUTOMATION(500, "Districts A MAIN _ B PROG Default")// Reset Default back to DCC Main & PROG
 SET_TRACK(A,MAIN) PRINT("Default Districts Tracks MAIN A & PROG B")
 SET_TRACK(B,PROG)
 DONE
AUTOMATION(501, "District A MAIN")   // Alternate DCC Main track A
 SET_TRACK(A,MAIN) PRINT("District A MAIN")
 DONE
AUTOMATION(502, "District A PROG")   // Alternate DCC PROG track A
 SET_TRACK(A,PROG) PRINT("District A PROG")
 DONE
AUTOMATION(503, "District A DC")     // Alternate DC track A with loco ID 1
 SETLOCO(1)
 SET_TRACK(A,DC) PRINT("District A DC")
 DONE
AUTOMATION(504, "District A DCX")    // Alternate DC_INV / DCX track A Changed to Opposite Polarity
 SET_TRACK(A,DCX) PRINT("District A DC_INV/DCX Opposite Polarity") // Track A Opposite Polarity DC
 DONE
AUTOMATION(505, "District A NONE")    // A Track disabled
 SET_TRACK(A, NONE) PRINT ("District A disabled")
 DONE
Copy and repeat AUTOMATION(506-510, District B  mode)
 and create any additional combinations or tracks C - H as you add more motor drivers.

exrail list of track manager functions for engine driver automatic assign [handoff] buttons

EXRAIL Track Manager Functions for Engine Driver 'Automation' [Handoff] buttons

In a |EX-R| Automation script we could a Set a Loco Address to a specific track in DC mode and have it run on Automation through the layout.
See the sixth Engine Driver Throttle image 'EXRAIL 202 Roundhouse to Turntable Back & Forth - Timed' [Handoff] button at the end.

 Automation script we could a Set a Loco Address to a specific track in DC mode and have it run on Automation through the layout.

See the sixth Engine Driver Throttle image ‘EXRAIL 202 Roundhouse to Turntable Back & Forth - Timed’ [Handoff] button at the end.

AUTOMATION(202,"Roundhouse to Turntable Back & Forth -Timed")
  SETLOCO(1225)
  SET_TRACK(B,DC)
  Run a your Roundhouse script blow whistle, run Forward delay wait and run Reverse delay stop
  DELAYRANDOM(msec, msec) // randomise the run time between runs
  DONE

exrail track manager functions for engine driver 'automation' [handoff] buttons

EXRAIL Track Manager Functions for Engine Driver 'Route' [Set] buttons

In an EXRAIL Automation script we could Set a Loco Address to a specific track in DC mode and Manually run a preassigned address on the layout.

ROUTE(1225,"Set track B to DC 1225")
  CLOSE(1)         // Close Turnout 1
  THROW(2)         // Throw Turnout 2
  DONE

All done through DCC-EX TrackManager with a simple push of a GUI button of Either or Both |Engine Driver| Handoff to Acquire the last Throttle Engine# used and run it on the mode of the track  [i.e. DC engine 1225], Or |Engine Driver| (Set) button to set a block to a specific mode.

All done through DCC-EX TrackManager with a simple push of a GUI button of Either or Both 

 Handoff to Acquire the last Throttle Engine# used and run it on the mode of the track  [i.e. DC engine 1225], Or 

TrackMagic uses the road number ID of a DC Engine in a throttle to run it on a assigned track/district/block, mimicking the look of DCC Engines.
No DPDT Switches are required, all waveform mode switching is done by Track Manager Software instructions.

exrail track manager functions for engine driver 'route' [set] buttons

Cool thing is the new |EX-R| Automation(n) & Routes(n) work the same with DCC engines on MAIN tracks and the DC engines on DC or DC_INV / DCX tracks, along with the Sensors, Servos /Turnouts, Signals & MP3 Sound DFPlayer triggers with little or no script changes other than maybe the FWD(n) & REV (n) Speeds.

 Automation(n) & Routes(n) work the same with DCC engines on MAIN tracks and the DC engines on DC or DC_INV / DCX tracks, along with the Sensors, Servos /Turnouts, Signals & MP3 Sound DFPlayer triggers with little or no script changes other than maybe the FWD(n) & REV (n) Speeds.

With the new DCC-EX direct WiFi Discovered Server you can connect |Engine Driver| & other WiThrottle app based throttles directly and have |EX-R| [Handoff] & [Set] buttons to run |EX-R| scripts from the throttles.

With the new DCC-EX direct WiFi Discovered Server you can connect 

These are DCC-EX Major feature/benefits because with other systems you'll have to use a PC computer or Pi processor & |JMRI| for WiThrottle Server throttle access and you have to write two different |JMRI| Jython.py scripts and then Setup Tools> Tables> Routes for for both DCC and DC automation & routes runs.

These are DCC-EX Major feature/benefits because with other systems you’ll have to use a PC computer or Pi processor & 

 for WiThrottle Server throttle access and you have to write two different 

 Jython.py scripts and then Setup Tools> Tables> Routes for for both DCC and DC automation & routes runs.

DCC-EX TrackManager 4.2.50+ is perfect for NMRA DCC Standards Modular Layouts which have two MAIN tracks/districts,
Track A and Track B with sidings;

Track B (westbound) which also have all the siding and spurs, wired rails L+  R-

DC_INV / DCX is Opposite Polarity and is what you set Block B to when you want it in DC mode because it is wired to NMRA Modular DCC Standards L+, R-.

Using the TrackManager Function commands you can run the any layout as

MAIN & PROG    (Use JOIN function for a Programming track to make a MagicTrack)

or any combination with up to 8 separate dual insulated tracks/districts from A - H.

- DCC PE 1225 on District A DCC address 1225 Sound Decoder
-  DC NH  667 on District B DC address  667 with IPLS Virtual Sound Decoder

DC NH  667 on District B DC address  667 with IPLS Virtual Sound Decoder

.. figure:: /_static/images/track_manager/trackmanager_engine_driver_1.png
  :alt: Track Manager ED 1

  Track Manager - Engine Driver 1

.. figure:: /_static/images/track_manager/trackmanager_engine_driver_2.png
  :alt: Track Manager

  Track Manager

- Scroll through & select track modes
- Takes the current selected Active Throttle Engine and assigns that Address to the DC or DC_INV / DCX track

Takes the current selected Active Throttle Engine and assigns that Address to the DC or DC_INV / DCX track

.. figure:: /_static/images/track_manager/trackmanager_engine_driver_3.png
  :alt: Track Manager handoff

  Track Manager - Engine Driver handoff

- TrackManager MAIN & PROG
- With |DCC-EX| Cmd Line & |Serial monitor|

.. figure:: /_static/images/track_manager/trackmanager_engine_driver_4.png
  :alt: Track Manager DCC-EX native mode

  Track Manager - Engine Driver DCC-EX native mode

- TrackManager District A DCC MAIN
- TrackManager District B  DC  667

.. figure:: /_static/images/track_manager/trackmanager_engine_driver_5.png
  :alt: Track Manager A/B

  Engine Driver - Track Manager A/B

**Engine Driver EXRAIL Automation [Handoff] and FX special effects buttons**

Engine Driver EXRAIL Automation [Handoff] and FX special effects buttons

.. figure:: /_static/images/track_manager/trackmanager_engine_driver_6.png

.. figure:: /_static/images/track_manager/trackmanager_engine_driver_7.png
  :alt: Track Manager handoff/set

  Track Manager - Engine Driver handoff/set

The |Engine Driver| |EX-R| screens shown above are all created through user defined |EX-R| Automation(n) and Route(n) scripts which are automatically passed to both |Engine Driver| & WiThrottle App screens as well as the Train Control Systems TCS Universal WiFi UWT-50 and UWT-100 tactile throttles all via direct connect DCC-EX |WITHROTTLE PROTOCOL| interface.

 Automation(n) and Route(n) scripts which are automatically passed to both 

 & WiThrottle App screens as well as the Train Control Systems TCS Universal WiFi UWT-50 and UWT-100 tactile throttles all via direct connect DCC-EX 

Please see the specific Smartphone App & Universal WiFi Throttle instructions on how to enable their Preferences and Route screens.
https://dcc-ex.com/throttles/index.html#withrottle-protocol-based-throttles

News and Announcements from the DCC-EX team. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

.. image:: /_static/images/logos/product-logo-news.png
  :alt: DCC-EX News
  :class: image-product-logo-float-right

Whether you are using |JMRI| as a controller/front-end to send commands to your track, handle turnouts/points, read and write CVs, or using any other software or the serial monitor, the commands are still the same. We have expanded the API (Application Programming Interface) to add new commands and provide new responses, but they won't affect your old control methods. One example of a new command is the one to handle turning power on and off to individual tracks.

 as a controller/front-end to send commands to your track, handle turnouts/points, read and write CVs, or using any other software or the serial monitor, the commands are still the same. We have expanded the API (Application Programming Interface) to add new commands and provide new responses, but they won’t affect your old control methods. One example of a new command is the one to handle turning power on and off to individual tracks.

While we made minor changes to the original DCC++ "BaseStation-Classic", all new development is going forward with the |EX-CS|. At first, we expanded features, added functionality, and fixed bugs by working from the existing code base.

While we made minor changes to the original DCC++ “BaseStation-Classic”, all new development is going forward with the 

. At first, we expanded features, added functionality, and fixed bugs by working from the existing code base.

The updated |BSC| release of DCC++ will be familiar to any of you who played with the code. However, we want to stress that the newer releases, |EX-CS|, are a complete re-write from the ground up and is greatly improved.

 release of DCC++ will be familiar to any of you who played with the code. However, we want to stress that the newer releases, 

, are a complete re-write from the ground up and is greatly improved.

Programming track turned on automatically when programming and off when finished

User add-on functions (intercept commands to route to your own routines)

HAL - Hardware abstraction layer to make adding new types of hardware simple

Built-in |WiThrottle Server| to directly support |WiThrottle Protocol| based throttles

Easy to create motor definition for motor drivers not in our current list

New |DCC-EX| features added to |JMRI| like a current monitor display

Custom add-ons for |Engine Driver| including Routes and Automations on buttons

Extensive logs and diagnostics in a serial monitor or the |JMRI| DCC++ log window

Developed a new browser based throttle (:doc:`EX-WebThrottle </ex-webthrottle/index>`)

New "DriveAway" feature to be able to recognise a loco on a siding used as a programming track and drive off of onto the main track

New “DriveAway” feature to be able to recognise a loco on a siding used as a programming track and drive off of onto the main track

We assembled a team of software developers and electronics engineers from around the world, created a plan, and started work early in 2020. (See the team information and credits on the :doc:`About page </about/index>`)

We assembled a team of software developers and electronics engineers from around the world, created a plan, and started work early in 2020. (See the team information and credits on the 

We started with the DCC Signal Generation code, what we call the "Waveform Generator". We got together as a team and looked at how we could make it better. It soon became clear that rather than make piecemeal changes, the entire concept of how the signal could be generated, and how to use timers and interrupts, would need to be re-imagined. This not only sped things up considerably, but allowed us to allow you to connect some shields right on top of your Command Station board without jumpers!

We started with the DCC Signal Generation code, what we call the “Waveform Generator”. We got together as a team and looked at how we could make it better. It soon became clear that rather than make piecemeal changes, the entire concept of how the signal could be generated, and how to use timers and interrupts, would need to be re-imagined. This not only sped things up considerably, but allowed us to allow you to connect some shields right on top of your Command Station board without jumpers!

Next we focused on packet generation. We looked at the complexities of reading and maintaining code that was using binary math, multiple "registers" to hold train data, and doing bit shifting everywhere to build bytes and stuff them into data packets. The new method gets rid of the old registers and simplifies the whole structure for building packets. Things like start and stop bits and preamble bits are static pieces of information. So being able to just insert them where they need to go saves time and processor bandwidth.

Next we focused on packet generation. We looked at the complexities of reading and maintaining code that was using binary math, multiple “registers” to hold train data, and doing bit shifting everywhere to build bytes and stuff them into data packets. The new method gets rid of the old registers and simplifies the whole structure for building packets. Things like start and stop bits and preamble bits are static pieces of information. So being able to just insert them where they need to go saves time and processor bandwidth.

We created an internal API for how modules communicated with each other, so the code is more modular and each unit is dedicated to its specific task.

We completely re-wrote current sense and ACK detect routines to better protect your trains and make programming more accurate. There are complete diagnostics to allow you to see see exactly why a particular decoder is not reading or writing, and we provide settings you can add to your configuration to get it to work in most cases.

First and foremost, we just wanted to have fun. We saw an engineering problem and we wanted to tackle it. As is the case with most engineers, we thought we could do it better than anyone else. ;) Second, we saw an opportunity to provide something really amazing to the Model Railroad Community for low cost and that worked as well or better than anything on the market.

We needed a platform that would allow us to grow into the future. The first thing we found was that in order to allow easy changes and to be able to adapt to technology we might want to use going forward, the code needed to be more modular. Each unit needed to be a "black box" that either did just one task and did it well, or take input and generate output without having to know anything about the module it was communicating with. Therefore, we created an internal API through which the modules could communicate. By simply unplugging one unit and plugging in another we could continue to work using different devices. An example of this is input and output. It doesn't matter whether |JMRI| is sending commands to the |EX-CS| or if it is a wireless Cab Controller. It doesn't matter if the output device is the serial monitor or an |I2C| display. It doesn't matter if you want to use a serial port or a network device to route data. This makes it very easy to implement new features with new devices. We just have to create a small interface for whatever new device we want to implement. This has the side benefit of allowing the code to be more readable.

We needed a platform that would allow us to grow into the future. The first thing we found was that in order to allow easy changes and to be able to adapt to technology we might want to use going forward, the code needed to be more modular. Each unit needed to be a “black box” that either did just one task and did it well, or take input and generate output without having to know anything about the module it was communicating with. Therefore, we created an internal API through which the modules could communicate. By simply unplugging one unit and plugging in another we could continue to work using different devices. An example of this is input and output. It doesn’t matter whether 

 or if it is a wireless Cab Controller. It doesn’t matter if the output device is the serial monitor or an 

 display. It doesn’t matter if you want to use a serial port or a network device to route data. This makes it very easy to implement new features with new devices. We just have to create a small interface for whatever new device we want to implement. This has the side benefit of allowing the code to be more readable.

Next, the Waveform Generator needed 2 timers and interrupts, one for the Main track signal and one for the Programming track. The Uno only has 3 timers. So 2 of them were already tied up for sending the DCC signal. Since the programming track sits idle most of the time, and both signals were always being generated to the input of the motor board, processing power was being wasted that could be put to use for something else. In addition, because of the way the Arduino is designed, we were forced to use jumpers to connect pins on the Arduino to those on the motor board. Our new design eliminates the need for jumpers!

The packet generation routine was complex, hard to maintain, and limited us with regard to the hardware we could run on and new features we could implement (like the Railcom cut-out). We replaced the slow DigitalRead() and DigitalWrite() routines with a fast write library. The packet generation is now streamlined, fast (which allows us to be able to use only 1 timer to create signals for 2 tracks), and much easier to read.

We made a huge effort to streamline the code and optimise it for microcontrollers to use the limited memory we have available in the most efficient manner. The code is now object oriented and utilises classes for readability and reusability. We eliminated almost all use of strings.

The 3 most requested features were: 1. More reliable CV read and writes, 2. Better accessory control, 3. Automation. Some have requested a Railcom cut-out. We haven't limited ourselves to just these features, but we put a lot of time into redesigning things to accommodate them.

The 3 most requested features were: 1. More reliable CV read and writes, 2. Better accessory control, 3. Automation. Some have requested a Railcom cut-out. We haven’t limited ourselves to just these features, but we put a lot of time into redesigning things to accommodate them.

The current detection routines are completely different. One key difference is all current readings are in milliAmps (mA) instead of meaningless pin readings. So if you want to set your overload protection to kick in at 3 Amps, you just enter 3000 for 3000mA instead of looking up a value from a table.

We continue to test all the motorboard and Arduino combinations at different voltages to refine our current readings. This is important because we want to have accurate and fast short-circuit detection, and because the reason CV reading was occasionally unreliable in the past was due to not always sensing a current pulse on the track. In addition to more accurately reading current, we had to completely change the way we look for an "ACK" (acknowledgement from the train that it received a command). So we now check immediately after we send a command instead of waiting for a dozen or more packets. This means we don't miss an ACK while this is happening, and we jump out of sending unnecessary packets as soon as we get one. We also use our knowledge of CVs and the probability of what a CV may contain, so save time by skipping ahead if our first guess is correct. You will appreciate how much faster we can read CVs now!

We continue to test all the motorboard and Arduino combinations at different voltages to refine our current readings. This is important because we want to have accurate and fast short-circuit detection, and because the reason CV reading was occasionally unreliable in the past was due to not always sensing a current pulse on the track. In addition to more accurately reading current, we had to completely change the way we look for an “ACK” (acknowledgement from the train that it received a command). So we now check immediately after we send a command instead of waiting for a dozen or more packets. This means we don’t miss an ACK while this is happening, and we jump out of sending unnecessary packets as soon as we get one. We also use our knowledge of CVs and the probability of what a CV may contain, so save time by skipping ahead if our first guess is correct. You will appreciate how much faster we can read CVs now!

There are now full diagnostics for trying to determine why a particular decoder may not be reading or writing correctly and new commands to adjust parameters to deal with decoders that are not in compliance with NMRA specifications. We use resolution down to the microsecond.

We not only are working on a RailCom cutout within the Command Station, but are developing a way of reading the RailCom data and reporting it.

|EX-R| (Extended Railroad Automation Interface for Layouts) brings new capability to the world of automation. You don't have to be a programmer to write a script that tells a train to start moving forward at a set speed until some action (like reaching a sensor) occurs! We will be providing a document and tutorial on EXRAIL once Beta testing is complete. This will be an open-ended project, since who knows what things people will come up with that they want to automate! It will be easy to extend the commands to handle whatever your imagination can dream of.

 (Extended Railroad Automation Interface for Layouts) brings new capability to the world of automation. You don’t have to be a programmer to write a script that tells a train to start moving forward at a set speed until some action (like reaching a sensor) occurs! We will be providing a document and tutorial on EXRAIL once Beta testing is complete. This will be an open-ended project, since who knows what things people will come up with that they want to automate! It will be easy to extend the commands to handle whatever your imagination can dream of.

So while maintaining proper deference to Gregg Berman's original concept of an inexpensive Command Station based on the Arduino platform, we don't want to do a disservice to |DCC-EX| or developers like Chris Harlow (UkBloke), Harald Barth, Neil McKechnie, Dave Cutting, and others, who brought a new vision to the project, and who used very little of the original code. This is NOT DCC++ v2.0, this is a completely new, yet API and feature compatible, Command Station. And just a tease: What Command Station would be complete without a wireless Cab Controller that speaks DCC++? Keep looking at our web page for new announcements...

So while maintaining proper deference to Gregg Berman’s original concept of an inexpensive Command Station based on the Arduino platform, we don’t want to do a disservice to 

 or developers like Chris Harlow (UkBloke), Harald Barth, Neil McKechnie, Dave Cutting, and others, who brought a new vision to the project, and who used very little of the original code. This is NOT DCC++ v2.0, this is a completely new, yet API and feature compatible, Command Station. And just a tease: What Command Station would be complete without a wireless Cab Controller that speaks DCC++? Keep looking at our web page for new announcements…

This is a team effort. There are a dedicated and organised group of about 15-20 core people involved in the project. In addition, there is all of you who contribute with your comments, feature ideas, evangelizing and testing. So we give you our heartfelt thanks. We will see you online!

Announcing version 4.0 of its EX-CommandStation software with EXRAIL automation and accessory control.

*Operators can now have a fully automated model railroad or a separate accessory control bus for their entire layout and read CVs up to 8 times faster*

Operators can now have a fully automated model railroad or a separate accessory control bus for their entire layout and read CVs up to 8 times faster

**Holly Springs, North Carolina USA** - DCC-EX released the next version of its popular free and open source DCC Command Station software today. Version 4.0 of |EX-CS| includes the new EXRAIL :sup:`tm` (Extended Railroad Automation Instruction Language) system that revolutionises the way model railroaders can control and interact with their layouts. This new concept allows users to fully automate the operation of their trains and to manage turnouts/points, signals, lights, automations, animations, and virtually any kind of sensor, switch, servo, motor, or output, all with a very simple set of commands.

 - DCC-EX released the next version of its popular free and open source DCC Command Station software today. Version 4.0 of 

 (Extended Railroad Automation Instruction Language) system that revolutionises the way model railroaders can control and interact with their layouts. This new concept allows users to fully automate the operation of their trains and to manage turnouts/points, signals, lights, automations, animations, and virtually any kind of sensor, switch, servo, motor, or output, all with a very simple set of commands.

|EX-CS| :sup:`tm` with |EX-R| runs on inexpensive and readily available hardware like the Arduino and Teensy series of microcontrollers and supports standard switches, servos, and accessory boards.

 runs on inexpensive and readily available hardware like the Arduino and Teensy series of microcontrollers and supports standard switches, servos, and accessory boards.

Concurrent with this rollout, enhancements to the popular |JMRI| model railroad software and |Engine Driver| smartphone and tablet app integrate tightly with the new features. Operators can create routes or automation/animation sequences and have them appear as buttons in |Engine Driver|. Press a button to begin an automation, or drive trains manually and press a button to hand them off to |EX-R| to run everything unattended. Take back control with another press of a button.

 smartphone and tablet app integrate tightly with the new features. Operators can create routes or automation/animation sequences and have them appear as buttons in 

. Press a button to begin an automation, or drive trains manually and press a button to hand them off to 

 to run everything unattended. Take back control with another press of a button.

Users no longer have to search for “sketches” and libraries or learn complicated C++ programming. There is no need to modify the |EX-CS| software and risk bringing the whole system down. The only file that needs to be modified is a myAutomation file where simple commands allow the operator to define their devices and tell them what to do when the conditions they specify are triggered. An engine can be sent out from the yard, triggering turnouts/points to engage for a specific route. Along the way, all the signals and crossings operate automatically in response to sensors along the track or timings or other conditions specified by the operator.

Users no longer have to search for “sketches” and libraries or learn complicated C++ programming. There is no need to modify the 

 software and risk bringing the whole system down. The only file that needs to be modified is a myAutomation file where simple commands allow the operator to define their devices and tell them what to do when the conditions they specify are triggered. An engine can be sent out from the yard, triggering turnouts/points to engage for a specific route. Along the way, all the signals and crossings operate automatically in response to sensors along the track or timings or other conditions specified by the operator.

Animations that involve a sequence, like operating cranes, arc welders, station operations, trolleys, etc. are simple to script. To make it even easier, EXRAIL comes with many standard sequences so that an operator just needs to copy them into their script, load the file into their Command Station and connect their devices. For the first time, everything can be run from the Command Station, without the need for separate devices running custom C++ programs scattered all over the layout.

Interfacing with hardware has never been easier with the new HAL (Hardware Abstraction Layer) feature. Supported hardware such as port expander and servo controller boards are automatically detected. New types of hardware can be added by implementing a driver from a standardised interface without having to write a custom program.

The new DriveAway :sup:`tm` feature allows users to drive an engine onto a siding or other electrically isolated block used as a programming track. The engine can be programmed and then driven back onto the main section of the layout, all without touching the locomotive.

 feature allows users to drive an engine onto a siding or other electrically isolated block used as a programming track. The engine can be programmed and then driven back onto the main section of the layout, all without touching the locomotive.

|EX-CS| has enhanced capabilities to read difficult decoders, provide detailed diagnostics to avoid the dreaded “308 Error”,  and when using JMRI with CV values matching what is in the its decoder file, improve performance by a factor of 8x. Reading and writing CVs in general, whether using |JMRI| or another method, is still significantly faster than before.

 has enhanced capabilities to read difficult decoders, provide detailed diagnostics to avoid the dreaded “308 Error”,  and when using JMRI with CV values matching what is in the its decoder file, improve performance by a factor of 8x. Reading and writing CVs in general, whether using 

DCC-EX is a global joint effort of a group of developers and engineers located in the US, UK, Sweden, France, Australia, New Zealand, and India. For more information visit their website at https://www.dcc-ex.com.

DCC-EX is a global joint effort of a group of developers and engineers located in the US, UK, Sweden, France, Australia, New Zealand, and India. For more information visit their website at 

`PDF version of this pressser for download </_static/documents/press_release_v40.pdf>`_

You may notice the jump from version 3.x to 4.0, this is because 4.0 is a MAJOR release. There are huge additions and changes. Here is a list of the highlights. To see the full release notes, continue to the link below.

We developed a Hardware Abstraction Layer (HAL) to allow for snap-in modules for different hardware and accessories. We will be both processor and input/output agnostic. This means you are insulated from the complexity of different hardware. Switches, lights, servos, etc., will all go through the same interface.

Rather than trying to maintain detailed release notes in multiple places, we provide a link below to the original file on our GitHub page. You can read the file there or download it. If you already have installed the Command Station sketch to your local machine, you will have the release notes for the version you download in your |EX-CS| project folder. Click on the link below for our most current release notes.

Rather than trying to maintain detailed release notes in multiple places, we provide a link below to the original file on our GitHub page. You can read the file there or download it. If you already have installed the Command Station sketch to your local machine, you will have the release notes for the version you download in your 

 project folder. Click on the link below for our most current release notes.

Note that this will show the release notes for the latest "master" build that you can download and install and may contain changes that are not in the last "official" release. The master version is the current stable version, while the official release is the one bundled and installed from the installer and downloaded from the download link.

Note that this will show the release notes for the latest “master” build that you can download and install and may contain changes that are not in the last “official” release. The master version is the current stable version, while the official release is the one bundled and installed from the installer and downloaded from the download link.

In order to better fit with our mission and provide a more clear and consistant image as our offerings expand, we have changed our name from 

In order to better fit with our mission and provide a more clear and consistant image as our offerings expand, we have changed our name from **'DCC++ EX'** to |DCC-EX|, dropping the **'++'**.

We have also changed our product names to have a consistent form of **EX-<product name>** (without spaces in the product names if there are multiple words).

We have also changed our product names to have a consistent form of 

 (without spaces in the product names if there are multiple words).

|EX-CS| |_| - |_| |EX-I| |_| - |_| |EX-WT| |_| - |_| |EX-R| |_| - |_| |EX-TT| |_| - |_| |EX-DCCI|

To go along with it we have created logos for the individual products

|EX-CS-LOGO-SMALL| |EX-I-LOGO-SMALL| |EX-WT-LOGO-SMALL| |EX-R-LOGO-SMALL| |EX-TT-LOGO-SMALL| |EX-DCCI-LOGO-SMALL| |EX-BSC-LOGO-SMALL|

When we began this journey, we picked up on the work of Gregg E. Berman who created the original Arduino based DCC "Base Station", called "DCC++". He chose that name as a play on words between the NMRA's "Digital Command Control" specification, "DCC", and the computer programming language used on the Arduino called "C++". If you put DCC and C++ together, you get DCC++. So DCC++ became the product name. When we extended and ultimately completely rewrote the software inspired by DCC++, we chose the name "DCC++EX" for "DCC++ Extended". Over time and with much input from users, we decided we needed to make some changes.

When we began this journey, we picked up on the work of Gregg E. Berman who created the original Arduino based DCC “Base Station”, called “DCC++”. He chose that name as a play on words between the NMRA’s “Digital Command Control” specification, “DCC”, and the computer programming language used on the Arduino called “C++”. If you put DCC and C++ together, you get DCC++. So DCC++ became the product name. When we extended and ultimately completely rewrote the software inspired by DCC++, we chose the name “DCC++EX” for “DCC++ Extended”. Over time and with much input from users, we decided we needed to make some changes.

The first change was calling the "Base Station" a "Command Station". This better reflected standardised terms used in the model railroading community.

The first change was calling the “Base Station” a “Command Station”. This better reflected standardised terms used in the model railroading community.

We also noticed that there was confusion between our company/team name and the product. "DCC-EX" is the company while DCC++EX was our first product, the Command Station. DCC++EX was being used interchangeably to refer to both the company and the command station. Additionally, DCC++EX is a mouthful, it is difficult to pronounce and requires special characters (the plus signs) when written or typed. This causes issues on places that do not accept plus signs in names, like GitHub and Google.

We also noticed that there was confusion between our company/team name and the product. “DCC-EX” is the company while DCC++EX was our first product, the Command Station. DCC++EX was being used interchangeably to refer to both the company and the command station. Additionally, DCC++EX is a mouthful, it is difficult to pronounce and requires special characters (the plus signs) when written or typed. This causes issues on places that do not accept plus signs in names, like GitHub and Google.

For the above reasons, and since we have long ago expanded byond the original DCC++ project, we felt it was best to drop the "++". At the same time, we needed to address the fact that we had a growing list of products and trademarks that should be consistent. While "EX" was always in the name, sometimes it was as a prefix and sometimes as a suffix. To remedy this, all our offerings now begin with "EX", as in "EX-CommandStation" or "EX-CS" for short.

For the above reasons, and since we have long ago expanded byond the original DCC++ project, we felt it was best to drop the “++”. At the same time, we needed to address the fact that we had a growing list of products and trademarks that should be consistent. While “EX” was always in the name, sometimes it was as a prefix and sometimes as a suffix. To remedy this, all our offerings now begin with “EX”, as in “EX-CommandStation” or “EX-CS” for short.

Everything you knew and loved about what we now call "DCC++ Classic". We have kept the old DCC++ command language and extended it. Switching to EX-CommandStation from DCC++ is a simple upgrade, and using accessories like throttles that speak the DCC++ command language still work as before (with many improvements).

Everything you knew and loved about what we now call “DCC++ Classic”. We have kept the old DCC++ command language and extended it. Switching to EX-CommandStation from DCC++ is a simple upgrade, and using accessories like throttles that speak the DCC++ command language still work as before (with many improvements).

(These still refer to to DCC++EX and will be changed over time) :

With a drum roll playing in the background, I am please to announce that the DCC-EX team has released version 4.1.1.

As of last night that is the new official version available for download from our web side. This is considered a minor update but it does include a few bug fixes, the primary one being able to read long loco id's. Included as well are several technical updates and for the one percent that understand the meaning, I saw coding words such as ACK, ATGTE and ATLT. For the 99 percent of us out there, some of the new features include the ability to fade an led when using a pca9685 board, a KILLALL function that stops all EXRAIL as well as diagnostic command, and new commands to help throttle developers.

As of last night that is the new official version available for download from our web side. This is considered a minor update but it does include a few bug fixes, the primary one being able to read long loco id’s. Included as well are several technical updates and for the one percent that understand the meaning, I saw coding words such as ACK, ATGTE and ATLT. For the 99 percent of us out there, some of the new features include the ability to fade an led when using a pca9685 board, a KILLALL function that stops all EXRAIL as well as diagnostic command, and new commands to help throttle developers.

An interesting thought occurred to me as I was planning the writing of the update. Before it is published it gets the approval from multiple team members. Looking at it in a different light, approval came from the United Kingdom, Sweden, Australia, Canada, as well as the United States. That illustrates why DCC-EX is becoming a dominant player in the control of model railroads. Keep the downloads coming!!

The DCC-EX Team is pleased to release CommandStation-EX v4.1.2 as a Production Release for the general public.
This release is a Minor release with many significant EXRAIL enhancements and new automation features in addition to some bug fixes.
The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.2.

ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 20000uS for more compatibility with non NMRA compliant decoders

Automatically detect and run a myFilter add-on (no need to call setFilter)

New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor

  * </RED signal_id> to turn a individual LED Signal On & Off
  * </AMBER signal_id> "
  * </GREEN signal_id> "
  * </KILL ALL> command to stop all tasks, and Diagnostic messages when KILL is used
  * < t cab> command to obtain current throttle setting

* </RED signal_id> to turn a individual LED Signal On & Off
* </AMBER signal_id> "
* </GREEN signal_id> "
* </KILL ALL> command to stop all tasks, and Diagnostic messages when KILL is used
* < t cab> command to obtain current throttle setting

</KILL ALL> command to stop all tasks, and Diagnostic messages when KILL is used

Updated CV read command . Equivalent to <V cv 0>. Uses the verify callback.

New JA, JR, JT commands availabe for Throttle Developers to obtain Route, Roster and Turnout descriptions for communications

New EXRAIL Functions to use in Automation(n), ROUTE(N) & SEQUENCE(N) Scripts

  * ATGTE & ATLT wait for analog value, (At Greater Than or Equal and At Less Than a * certain value)
  * FADE command now works for LEDs connected on PCA9685 Servo/Signal board Output vpins
  * FORGET Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track
  * "IF" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id)
  * KILLALL command to stop all tasks, and Diagnostic messages when KILL is used
  * PARSE <> commands in EXRAIL allows sending of DCC-EX commands from EXRAIL
  * SERVO_SIGNAL Servo signals assigned to a specific servo turnout
  * SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH)
  * HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown)
  * VIRTUAL_TURNOUT definition

* ATGTE & ATLT wait for analog value, (At Greater Than or Equal and At Less Than a * certain value)
* FADE command now works for LEDs connected on PCA9685 Servo/Signal board Output vpins
* FORGET Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track
* "IF" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id)
* KILLALL command to stop all tasks, and Diagnostic messages when KILL is used
* PARSE <> commands in EXRAIL allows sending of DCC-EX commands from EXRAIL
* SERVO_SIGNAL Servo signals assigned to a specific servo turnout
* SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH)
* HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown)
* VIRTUAL_TURNOUT definition

ATGTE & ATLT wait for analog value, (At Greater Than or Equal and At Less Than a * certain value)

FADE command now works for LEDs connected on PCA9685 Servo/Signal board Output vpins

FORGET Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track

"IF" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id)

“IF” signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id)

KILLALL command to stop all tasks, and Diagnostic messages when KILL is used

PARSE <> commands in EXRAIL allows sending of DCC-EX commands from EXRAIL

SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH)

HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown)

EXRAIL BROADCAST("msg") sends any message to all throttles/JMRI via serial and WiFi

EXRAIL BROADCAST(“msg”) sends any message to all throttles/JMRI via serial and WiFi

EXRAIL POWERON turns on power to both tracks from EXRAIL (the equivalent of sending the <1> command)

UNO Progmem is optimise to allow for small EXRAIL Automation scripts to run within the limited space for testing purposes.

PCA9685 Servo Signal board supports 'Nopoweroffleds', servo pins stay powered on after position reached, otherwise the new FADE would always turn off.

PCA9685 Servo Signal board supports ‘Nopoweroffleds’, servo pins stay powered on after position reached, otherwise the new FADE would always turn off.

Fixed Ethernet shield W5100 support since it does not report HW or link level like the W5200 and W5500 chips.

See the version.h file for notes about which of the 4.1.2 features were added/changed by point release.

Wi-Fi - Requires sending <AT> commands from a serial monitor if you want to switch between AP mode and STA station mode after initial setup

Pololu Motor Shield - is supported with this release, but the user may have to adjust timings to enable programming mode due to limitations in its current sensing circuitry

Yep, that’s right, the DCC-EX team are now publishing updates regularly with our new “DCC-EX News” feed!

Yep, that's right, the DCC-EX team are now publishing updates regularly with our new "DCC-EX News" feed!

We've come to realise we can do much better in communicating the various different projects the team is working on, when we are releasing new versions, when we've found/fixed bugs, and when we have news or announcements to share with all our users.

We’ve come to realise we can do much better in communicating the various different projects the team is working on, when we are releasing new versions, when we’ve found/fixed bugs, and when we have news or announcements to share with all our users.

So, without further adieu, we are sharing this very first post, and these will continue regularly as we have news to share.

We're continuing to work towards our next major release which will be v5.0.0, and will include some great new features:

- Track Manager (formerly called DC Districts), allowing you to run more than two motor driver outputs in DCC, DC, or programming track modes
- Support for newer generation, 32bit microcontrollers from STMicroelectronics
- Improvements to |I2C| connectivity including better timeout handling, the ability to reset the bus without rebooting the |EX-CS|, and support for multiplexors
- Included device drivers for |EX-TT|, |EX-FC|, and |EX-IO|

We’re continuing to work towards our next major release which will be v5.0.0, and will include some great new features:

Track Manager (formerly called DC Districts), allowing you to run more than two motor driver outputs in DCC, DC, or programming track modes

Support for newer generation, 32bit microcontrollers from STMicroelectronics

Improvements to |I2C| connectivity including better timeout handling, the ability to reset the bus without rebooting the |EX-CS|, and support for multiplexors

 connectivity including better timeout handling, the ability to reset the bus without rebooting the 

We're continuing to review and improve our website and ways to keep you informed (hence this news feed)

We’re continuing to review and improve our website and ways to keep you informed (hence this news feed)

We're working on new, open source hardware options to make the entry point to DCC-EX simpler for those who aren't up to the level of DIY currently required

We’re working on new, open source hardware options to make the entry point to DCC-EX simpler for those who aren’t up to the level of DIY currently required

If you wish to follow "DCC-EX News", we will have the latest few posts published on the front page of our website, along with the `complete list here <https://dcc-ex.com/news.html>`_.

If you wish to follow “DCC-EX News”, we will have the latest few posts published on the front page of our website, along with the 

If you use an RSS/Atom feed reader, you can add "DCC-EX News" by the URL "https://dcc-ex.com/news/atom.xml".

If you use an RSS/Atom feed reader, you can add “DCC-EX News” by the URL “

We look forward to sharing more news and information with you all!

|EX-TB| is a free, open source, Android app to help setup and configure your EX-CommandStation.

 is a free, open source, Android app to help setup and configure your EX-CommandStation.

|EX-TB| can be installed on you phone or table via the `Google Play Store <https://play.google.com/store/apps/details?id=dcc_ex.ex_toolbox>`_ . (Or search in the Play Store for "EX-Toolbox", including the quotes.)

`Google Play Store <https://play.google.com/store/apps/details?id=dcc_ex.ex_toolbox>`_

 . (Or search in the Play Store for “EX-Toolbox”, including the quotes.)

Current Meter (Only available when connected to EX-CommandStation version 5.0.0 and above.)

Track Manager (Only available when connected to EX-CommandStation version 5.0.0 and above.)

We are full steam ahead to a v5.0 release, making sure what’s in there is well tested to the limits of our resources, and has documentation available as we go.

We are full steam ahead to a v5.0 release, making sure what's in there is well tested to the limits of our resources, and has documentation available as we go.

Amongst other things, this has resulted in one potentially "breaking" change for users of |EX-R|'s capability to run sequences/routes on start-up.

Amongst other things, this has resulted in one potentially “breaking” change for users of 

**Breaking change:** The implicit AUTOSTART at the beginning of the "myAutomation.h" file for |EX-R| has been disabled, as we have found it confuses a great many first time users.

 The implicit AUTOSTART at the beginning of the “myAutomation.h” file for 

 has been disabled, as we have found it confuses a great many first time users.

What does this mean?

Previously, when your |EX-CS| started up with a "myAutomation.h" file present, anything defined prior to the very first ``DONE`` statement would execute automatically. This was used to do things like set turnouts/points to a known startup position, automatically start routes or sequences for fully automated layouts, and so forth.

As of v4.2.31, this behaviour is disabled, meaning nothing defined in "myAutomation.h" will automatically start unless preceded by the ``AUTOSTART`` directive (see :ref:`exrail/exrail-command-reference:scripts/sequences - types and control`).

 started up with a “myAutomation.h” file present, anything defined prior to the very first 

 statement would execute automatically. This was used to do things like set turnouts/points to a known startup position, automatically start routes or sequences for fully automated layouts, and so forth.

As of v4.2.31, this behaviour is disabled, meaning nothing defined in “myAutomation.h” will automatically start unless preceded by the 

:ref:`exrail/exrail-command-reference:scripts/sequences - types and control`

At the time of writing, we are currently at v4.2.37 of the |EX-CS| development release, and these updates are continuing multiple times a week as we find/fix bugs and refine the software.

 development release, and these updates are continuing multiple times a week as we find/fix bugs and refine the software.

Here are some more highlights of what's been done since the last news update:

Here are some more highlights of what’s been done since the last news update:

New <JG> and <JI> commands for multi-track gauges such as current sensing (v4.2.20)

Static IP address now configurable for Ethernet shields (v4.2.24)

SAMD21 had a bug in EXRAIL due to memory alignment, this likely improves 32-bit support for various microcontrollers (v4.2.25)

Improved stability/reliability of the |EX-IO| device driver (v4.2.26) and bug fix for analogue inputs (v4.2.34)

 device driver (v4.2.26) and bug fix for analogue inputs (v4.2.34)

Updated the DFPlayer code to cope with a new variant of the popular sound board seen in the wild, and mods to the HCRS04 ultrasonic driver so it uses less CPU loop time (v4.2.28)

Add new "FLAGS" device to the HAL to communicate Vpin changes outside of |EX-R| to software such as |JMRi| (v4.2.37)

Add new “FLAGS” device to the HAL to communicate Vpin changes outside of 

Some of the above new features and fixes are currently undocumented which we will fix in the coming weeks. In the meantime, feel free to jump onto Discord and chat with the developers and keep up to date (:doc:`/support/contact-us`).

Some of the above new features and fixes are currently undocumented which we will fix in the coming weeks. In the meantime, feel free to jump onto Discord and chat with the developers and keep up to date (

version 5 progress and a breaking change in the development branch

We're excited to announce the final version 4 release of |EX-CS| before we move to version 5!

This is just a minor bugfix release from the previous version 4.1.2. This release is a Bugfix release to fix the initialisation order to benefit Ethernet boards, to fix GitHub issue `#299 <https://github.com/DCC-EX/CommandStation-EX/issues/299>`_ related to TurnoutDescription, and to fix command parsing for LCN (the Layout Control Nodes Accessory Network).

This is just a minor bugfix release from the previous version 4.1.2. This release is a Bugfix release to fix the initialisation order to benefit Ethernet boards, to fix GitHub issue 

 related to TurnoutDescription, and to fix command parsing for LCN (the Layout Control Nodes Accessory Network).

To get the latest version, see the :ref:`download/ex-commandstation:latest ex-commandstation official release` section.

:ref:`download/ex-commandstation:latest ex-commandstation official release`

There is also an updated :ref:`reference/downloads/documents:comprehensive dcc-ex & jmri decoderpro getting started guide pdf` available for download to help you get up and running with |JMRi| DecoderPro and |DCC-EX|.

:ref:`reference/downloads/documents:comprehensive dcc-ex & jmri decoderpro getting started guide pdf`

|DCC-EX|, a global contributor to DCC open source software for model railroading, is proud to announce the first of our open source hardware products: the |EX-MS|, providing dual 5 amp |DCC| and |DC PWM| (pulse width modulation) output for |DCC-EX| |EX-CS|.

, a global contributor to DCC open source software for model railroading, is proud to announce the first of our open source hardware products: the 

The |EX-MS| addresses the needs of |DCC-EX| users wanting to run multiple locos, across multiple power districts without requiring expensive DCC boosters. A DCC-EX Command Station can now outperform commercial DCC command stations which typically have single 3-3.5A or 5A output capabilities, and doing so at a fraction of the cost and with more advanced features.

 users wanting to run multiple locos, across multiple power districts without requiring expensive DCC boosters. A DCC-EX Command Station can now outperform commercial DCC command stations which typically have single 3-3.5A or 5A output capabilities, and doing so at a fraction of the cost and with more advanced features.

The |EX-MS| is the first offering in the DCC-EX open source hardware ecosystem specifically designed for model railroaders, and is a direct result of the strong community engagement DCC-EX strives to inspire. DCC-EX hardware lead Paul Antoine says "the open source vision for hardware designs from the DCC-EX community means individual users can order small batch manufacturing of all DCC-EX endorsed designs for themselves, friends and fellow club members. Or they have the choice to buy the same quality of product from licensed local resellers in their countries of origin.”

 is the first offering in the DCC-EX open source hardware ecosystem specifically designed for model railroaders, and is a direct result of the strong community engagement DCC-EX strives to inspire. DCC-EX hardware lead Paul Antoine says “the open source vision for hardware designs from the DCC-EX community means individual users can order small batch manufacturing of all DCC-EX endorsed designs for themselves, friends and fellow club members. Or they have the choice to buy the same quality of product from licensed local resellers in their countries of origin.”

.. image:: /_static/images/motorboards/ex_motorshield8874.jpeg
   :alt: DCC-EX EX-MotorShield8874 RevA Semify

Featuring dual 5A output Texas Instruments DRV8874 MOSFET H-Bridge ICs, the EX-MotorShield8874 shield is fully drop-in compatible with the industry standard Arduino Motor Shield R3 due to additional logic onboard, along with plenty of new features. As a result, it can immediately replace older L298 based boards without software modifications. There is no need to have to cut traces or bend out pins, and the EX-MotorShield8874 can power your EX-CommmandStation too! The DRV8874 H-Bridge ICs also include hardware overcurrent protection monitored by EX-CommandStation, in addition to the existing software-based overload protection.

DCC-EX specific features include single 2.1mm barrel jack DC power for both the DCC/DC output and to supply the underlying Command Station motherboard with inbuilt polarity protection. This eliminates the need for a separate power supply for the Command Station motherboard. An onboard switching power supply regulates the DCC track input voltage to a safe 7.2VDC to the motherboard via the VIN pin, ensuring its linear 5V and 3.3V regulators stay as cool as possible.

EX-MotorShield8874 is also future-proof, being compatible with current Arduino UNO and Mega based DCC-EX command station motherboards, and the more powerful platforms under development which use 3.3V microcontrollers, such as STM32 Nucleo and ESP32 based designs.

EX-MotorShield8874 sports I2C support via an industry standard STEMMA QT/Qwiic connectors and pin headers making I2C bus connections easier than ever. The STEMMA QT/Qwiic ecosystem of I2C boards from Adafruit and Sparkfun are now the easiest I2C expansion boards to use. The DCC-EX team expects to add additional STEMMA QT/Qwiic based peripherals with model railroading friendly features in upcoming releases. An I2C SIP header is included to allow many I2C enabled OLED screens to plug directly into the board.

The design of the EX-MotorShield8874 was Inspired by a discussion on the Austrian 1zu160 N scale model railway forum between DCC-EX development team member Harald Barth and enthusiastic DCC-EX user Erwin Peterlin. Erwin then designed the prototype EX-MotorShield8874 in a matter of days. Erwin is a skilled Digital Design and Verification Engineer by day for his employer, Semify (semify-eda.com) of Austria, who kindly offered to fund the prototype boards. Semify has also arranged to sell their initial production test batch on Tindie.

Erwin worked closely with the DCC-EX team on specification of additional features to suit DCC-EX software, with early prototypes being provided to the DCC-EX team for testing and verification. We are proud to say that Erwin opted to become part of the DCC-EX team and will continue to work on future projects.

Erwin and Semify have graciously provided the design files for the EX-MotorShield8874 on an open source basis, allowing DCC-EX users to order small batches of up to 10 assembled units from manufacturers such as JLCPCB.

Entrepreneurs wanting to offer commercial quantities to their local communities should contact Semify (service @ semify-eda.com) to arrange a bulk purchase, or DCC-EX (support @ dcc-ex.com) when looking to use the design to manufacture. Licensing includes donating a royalty to DCC-EX per board sold. Semify has a separate arrangement with DCC-EX due to their funding of the prototyping and work on verifying and testing the design.

EX-MotorShield8874 is available immediately for purchase in the EU, USA and Canada via Semify's Tindie store (https://www.tindie.com/products/semify/semify-dcc-ex-motor-shield/) starting at $US34.90 each, and in Australia, New Zealand and South East Asia from Millennium Engineering Pty Ltd (orders @ milleng.com.au) for $AU55, plus shipping. It will also be available shortly in the UK through Chesterfield Model Making & Miniature Electronics (https://chesterfield-models.co.uk/product/semify-dcc-ex-motor-shield/), for £29.99 plus shipping. Expect further announcements re local availability in the US through DCC-EX directly and Smart Hobby LLC, with other countries to follow.

EX-MotorShield8874 is available immediately for purchase in the EU, USA and Canada via Semify’s Tindie store (

) starting at $US34.90 each, and in Australia, New Zealand and South East Asia from Millennium Engineering Pty Ltd (orders @ milleng.com.au) for $AU55, plus shipping. It will also be available shortly in the UK through Chesterfield Model Making & Miniature Electronics (

), for £29.99 plus shipping. Expect further announcements re local availability in the US through DCC-EX directly and Smart Hobby LLC, with other countries to follow.

Design files and initial hardware documentation are at: https://github.com/DCC-EX/EX-Motorshield8874 and installation details at: https://dcc-ex.com/reference/hardware/motorboards/ex-motor-shield-8874.html

DCC-EX Website will have further documentation for the EX-MotorShield8874, and extended support in software will be included in the upcoming EX-CommandStation v5.0 release scheduled for late May 2023.

Yes, that's right, the |DCC-EX| team is announcing we have an updated |EX-I|!

The previous version has been a welcome addition to the family and served many users well, however only caters for |EX-CS|, and has recently had issues for our Linux and macOS users, meaning it was time for a refresh.

The previous version has been a welcome addition to the family and served many users well, however only caters for 

, and has recently had issues for our Linux and macOS users, meaning it was time for a refresh.

Our new installer has been written in Python with a view to being portable across as many operating systems as possible and continues to use the Arduino Command Line Interface (CLI) in the background to manage loading the |DCC-EX| software onto your Arduino device.

Our new installer has been written in Python with a view to being portable across as many operating systems as possible and continues to use the Arduino Command Line Interface (CLI) in the background to manage loading the 

Further to this, the new |EX-I| has been written in a way that will allow you to install our other Arduino based products with it in the future, including |EX-IO|, |EX-TT|, |EX-FC|, and |EX-DCCI|.

 has been written in a way that will allow you to install our other Arduino based products with it in the future, including 

You just need to download one file for either Windows, Linux, or macOS in order to get up and running with the new |EX-I|, and it will take care of downloading our software and managing your Arduino device. [1]_

You just need to download one file for either Windows, Linux, or macOS in order to get up and running with the new 

, and it will take care of downloading our software and managing your Arduino device. 

For instructions on how to get the new |EX-I| and how to use it, head over to the :doc:`/ex-installer/index` page.

.. image:: /_static/images/installer/new-version.png
  :alt: New version

For Windows users with generic or clone Arduino devices, you will still need to install suitable USB to serial drivers (e.g. CH340/341) as the Arduino CLI only provides drivers for genuine Arduino devices.

**DCC-EX** has no plans to support the *Uno R4* or *Giga* at this time. For an explanation as to why it does not make sense for us to support these boards (at least right now), continue reading.

 at this time. For an explanation as to why it does not make sense for us to support these boards (at least right now), continue reading.

Firstly it is worth noting that while the DCC-EX team is not working on it, you are free to work with the team on a port and we will provide you with support and help if you feel up to the task.

Like you, we get excited when a new product is announced and can't wait to play with it. As beta testers (called the Arduino Early Experience Program), we are privileged to test these boards before they are released. While both the **Uno R4** and **Giga** are advancements to the Arduino platform, and are great products,

Like you, we get excited when a new product is announced and can’t wait to play with it. As beta testers (called the Arduino Early Experience Program), we are privileged to test these boards before they are released. While both the 

 are advancements to the Arduino platform, and are great products,

It is unfortunate (for us) that Arduino chose to carry on the "Uno" name with the Uno R4 board. The "R4" designator would create the impression that this is just "rev 4" of the old Uno Rev3. We all know from experience with versions of things that 4 comes after 3 and so this is just a faster, better Uno, right? Not quite. At least the new Giga was not called the Mega R4, though at $73 US, it is cost prohibitive for a command station.

It is unfortunate (for us) that Arduino chose to carry on the “Uno” name with the Uno R4 board. The “R4” designator would create the impression that this is just “rev 4” of the old Uno Rev3. We all know from experience with versions of things that 4 comes after 3 and so this is just a faster, better Uno, right? Not quite. At least the new Giga was not called the Mega R4, though at $73 US, it is cost prohibitive for a command station.

The Uno R4 is about as similar to the old Uno as a PC is to a Mac. It is the same size and has the same orientation of GPIO for attaching shields, but uses a completely different microcontroller (2 actually), from completely different manufacturers, using completely different architectures.

It is one thing to run a blink sketch on these new boards, but a completely different task trying to port software as involved at the hardware level as the EX-CommandStation. The R4 uses a different core library with limited support since many libraries still have to be rewritten. So it will take some time for support to build.

With design limitations of the R4, only a modest increase in memory and speed, and higher cost ($28 US), it isn't the best option when we already support the faster, less expensive ESPDuino32 (only $5-$10). We are also currently in beta test with the ST Micro Nucleo boards, including one with 144 GPIO pins and an Ethernet connection. These cost just $12 to $24 depending on the board and have an integrated debugger with a separate processor right on the board!

With design limitations of the R4, only a modest increase in memory and speed, and higher cost ($28 US), it isn’t the best option when we already support the faster, less expensive ESPDuino32 (only $5-$10). We are also currently in beta test with the ST Micro Nucleo boards, including one with 144 GPIO pins and an Ethernet connection. These cost just $12 to $24 depending on the board and have an integrated debugger with a separate processor right on the board!

All that said, we would still enjoy being able to run on Arduino boards whenever possible. As mentioned above, we are open to working with anyone with the time and talent who thinks they can port our software to these new boards. We can provide direction, code snippets, code reviews, and access to the team. In the meantime, we encourage everyone to take a look at our list of `Supported Microcontrollers <https://dcc-ex.com/ex-commandstation/advanced-setup/supported-microcontrollers/index.html#supported-microcontrollers>`_

All that said, we would still enjoy being able to run on Arduino boards whenever possible. As mentioned above, we are open to working with anyone with the time and talent who thinks they can port our software to these new boards. We can provide direction, code snippets, code reviews, and access to the team. In the meantime, we encourage everyone to take a look at our list of 

|NEW-IN-V5| Yep, that's right, the much anticipated |EX-CS| version 5 release is here at last! This is a huge release, adding significant new features like |TM|, enhancing existing capabilities, introducing new and enhanced I/O support, along with other associated products such as |EX-FC|, |EX-TT|, and |EX-IO|.

 version 5 release is here at last! This is a huge release, adding significant new features like 

, enhancing existing capabilities, introducing new and enhanced I/O support, along with other associated products such as 

We highly recommend upgrading to version 5 to take advantage of the improvements we've made, and especially for those users who are using our new |EX-MS|, as we've improved how it deals with overloads and inrush current amongst other enhancements.

We highly recommend upgrading to version 5 to take advantage of the improvements we’ve made, and especially for those users who are using our new 

, as we’ve improved how it deals with overloads and inrush current amongst other enhancements.

To get your hands on this latest release, select ``Latest Production`` when running |EX-I| (see :doc:`/ex-installer/installing`), or you can download it manually by following the directions in :ref:`download/ex-commandstation:latest ex-commandstation official release`.

), or you can download it manually by following the directions in 

We've outlined the key updates below but this is not an exhaustive list.

We’ve outlined the key updates below but this is not an exhaustive list.

|TM| - Run both DC and DCC trains from the same controller and switch your tracks between DC and DCC modes live, see :doc:`/trackmanager/index`

 - Run both DC and DCC trains from the same controller and switch your tracks between DC and DCC modes live, see 

Beta support for new, 32 bit microcontrollers including ESP32 WROOM and some STMicroelectronics Nucleo, see :doc:`/reference/hardware/microcontrollers/microcontrollers`

Beta support for new, 32 bit microcontrollers including ESP32 WROOM and some STMicroelectronics Nucleo, see 

Extensive optimisation of HIGHMEM useage to free up PROGMEM below the 64kb and increase the useful life of the AVR Mega2560 platform

Add option to disable programming to allow limited platforms such as the Arduino Uno to run limited |EX-R| scripts

Add option to disable programming to allow limited platforms such as the Arduino Uno to run limited 

Add support for our new fast clock |EX-FC|, see :doc:`/ex-fastclock/index`

Add support for our new I/O expander |EX-IO|, see :doc:`/ex-ioexpander/index`

Add support for our new turntable controller |EX-TT|, see :doc:`/ex-turntable/index`

Add support for duinoNodes, see :doc:`/ex-commandstation/accessories/inputs-outputs/duinonodes`

Enhanced overcurrent detection, including enhancing the behaviour to deal with inrush current issues

Support for |I2C| multiplexers to help with devices with static or limited address ranges

 multiplexers to help with devices with static or limited address ranges

Improved handling of conflicting |I2C| addresses and Vpin allocations

Add ``<JG>`` and ``<JI>`` for multi-track gauges to support |TM|

Bugfix for signals being inverted (active high was actually active low and vice versa)

We have one known issue in version 5 where DFPlayer doesn't work correctly in some circumstances, which we are investigating and will fix soon

We have one known issue in version 5 where DFPlayer doesn’t work correctly in some circumstances, which we are investigating and will fix soon

For details on these changes and new commands, refer to our new, consolidated :doc:`/exrail/exrail-command-reference`.

For details on these changes and new commands, refer to our new, consolidated 

**BREAKING CHANGE** Removed implicit ``AUTOSTART`` from myAutomation.h, simply add ``AUTOSTART`` to the beginning of the file to restore this, see :ref:`exrail/exrail-command-reference:scripts/sequences - types and control`

Enhance ``SPEED`` command to respond to external direction changes

Add ``DCC_SIGNAL`` command to control DCC Accessory based signals

Add ``VIRTUAL_SIGNAL`` command to enable user-defined signal sequences

Add ``ONGREEN``, ``ONAMBER``, and ``ONRED`` signal event handlers to respond to signal changes

Add ``TURNOUTL`` command to enable using a linear DCC address for DCC Accessory turnouts

 command to enable using a linear DCC address for DCC Accessory turnouts

Add ``ONCHANGE`` event handler to respond to a position change of a rotary encoder

 event handler to respond to a position change of a rotary encoder

Add ``ONCLOCKTIME`` and ``ONCLOCKMINS`` event handlers to respond to |EX-FC| times

Add ``IFLOCO`` command to test if the provided loco ID is used in the sequence

 command to test if the provided loco ID is used in the sequence

Add ``FORGET`` command to drop the provided loco ID from reminder tables

Add ``SERIAL4``, ``SERIAL5``, and ``SERIAL6`` to support newer microcontrollers with more/different interfaces

 to support newer microcontrollers with more/different interfaces

Add ``POWERON`` and ``POWEROFF`` commands to control track power

As always, we are continuing to ensure our website is updated, and endeavour to make it easier to use and find information.

.. image:: /_static/images/dark_mode.png
  :alt: Dark mode icon
  :align: right

The big change is that you can now choose "dark mode" by clicking the icon in bottom right corner.

The big change is that you can now choose “dark mode” by clicking the icon in bottom right corner.

Today, we bid a fond farewell to the old exInstaller, used successfully by many a user to load our flagship product 

Today, we bid a fond farewell to the old exInstaller, used successfully by many a user to load our flagship product |EX-CS| onto Arduino devices around the world and enable DCC control of many model railroading layouts.

 onto Arduino devices around the world and enable DCC control of many model railroading layouts.

As announced earlier this year, our new |EX-I| has been released to supersede our original installer, and over time will allow loading all our Arduino based products rather than just focusing on |EX-CS|.

 has been released to supersede our original installer, and over time will allow loading all our Arduino based products rather than just focusing on 

If you still use the original exInstaller, we encourage you to move to :doc:`/ex-installer/index` instead.

If you still use the original exInstaller, we encourage you to move to 

The old exInstaller has now been made a public archive, and no further development will occur.

Since our original announcement back on the 2nd of July 2023, |EX-I| has continued to be improved with both enhancements and bug fixes. Originally announced at version 0.0.12, this new announcement has |EX-I| at version 0.0.16, with quite a difference between these two releases!

 has continued to be improved with both enhancements and bug fixes. Originally announced at version 0.0.12, this new announcement has 

 at version 0.0.16, with quite a difference between these two releases!

Added an information menu with version and device information and links to our website and instructions

Added popup help for contextual help when hovering your mouse over various options

Various enhancements to contextual highlighting in Device Monitor

Various enhancements to configuring |EX-CS| including a refreshed configuration interface and support for newer features

 including a refreshed configuration interface and support for newer features

Added a tools menu in order to set screen scaling for smaller or larger screen sizes, and to help those of us who don't see as well as we used to

Added a tools menu in order to set screen scaling for smaller or larger screen sizes, and to help those of us who don’t see as well as we used to

Added some device specific limitations and recommendations, such as disabling Track Manager on Uno/Nano

Fixed an issue where Track Manager options were displayed for incorrect versions

Fixed an issue where Device Monitor was forced on top of all windows in Linux

Fixed an issue where closing the app with Device Monitor open could leave the Arduino CLI running in the background

Fixed an issue where Track Manager and current override options were disabled for |EX-CS| 5.0.0 or later

Fixed an issue where Track Manager and current override options were disabled for 

Fixed an issue in Device Monitor where the output was blank and/or flashing on older Linux versions

Fixed an issue where the Ethernet library was not installed when enabling Ethernet support for |EX-CS| (you must click "Refresh Arduino CLI" to have this installed)

Fixed an issue where the Ethernet library was not installed when enabling Ethernet support for 

Fixed an issue on Fedora Linux where SSL certificates were not available (a warning will still be seen for fonts which can be disregarded)

This is by no means an exhaustive list of the updates, so we highly recommmend downloading this latest version of |EX-I|.

This is by no means an exhaustive list of the updates, so we highly recommmend downloading this latest version of 

The |DCC-EX| team are proud to announce that we've released the very first version of our brand spanking new DCCEXProtocol Arduino Library! This has been written to make life easier for those wishing to write software for throttles or other clients that need to communicate with |EX-CS| using our native command API.

 team are proud to announce that we’ve released the very first version of our brand spanking new DCCEXProtocol Arduino Library! This has been written to make life easier for those wishing to write software for throttles or other clients that need to communicate with 

We figure for those who want to write throttle software and interact with the |EX-CS| are probably more interested in making their software work rather than figuring out how to correctly parse our native API commands and respond appropriately to the various command responses and broadcasts that are generated and need to be dealt with.

We figure for those who want to write throttle software and interact with the 

 are probably more interested in making their software work rather than figuring out how to correctly parse our native API commands and respond appropriately to the various command responses and broadcasts that are generated and need to be dealt with.

So, in light of this, a library that takes away the heavy lifting of using/interpreting the API commands seemed like a sensible approach.

**One great big caveat** to this announcement is that the library version is 0.0.1, meaning it has had limited testing and is likely going to have bugs associated with it.

 to this announcement is that the library version is 0.0.1, meaning it has had limited testing and is likely going to have bugs associated with it.

For documentation on how to implement and use the library, refer to the `DCCEXProtocol documentation <https://dcc-ex.com/DCCEXProtocol/index.html>`_.

For documentation on how to implement and use the library, refer to the 

`DCCEXProtocol documentation <https://dcc-ex.com/DCCEXProtocol/index.html>`_

Firstly, we wish all our users a rather belated Happy New Year as we present our first DCC-EX News article for 2024! The news today is we have released an updated version of our 

Firstly, we wish all our users a rather belated Happy New Year as we present our first DCC-EX News article for 2024! The news today is we have released an updated version of our |EX-I| (version 0.0.17).

This release includes the below changes, and as always we encourage you to download this latest version of :ref:`download/ex-commandstation:ex-installer` from our downloads page:

This release includes the below changes, and as always we encourage you to download this latest version of 

Update various Python module versions to resolve security vulnerabilities

Remove the option to select Arduino Nano with the old bootloader, as this has never worked

Prevent enabling WiFi for |EX-CS| on the Arduino Uno/Nano platforms as they don't have enough memory

 on the Arduino Uno/Nano platforms as they don’t have enough memory

Set the default CV programming option in |EX-CS| to enabled for the Arduino Uno/Nano platforms

Change the |EX-CS| start with power on option to use |EX-R| ``POWERON`` instead of ``JOIN``

Add the ability to override local changes made to |EX-CS|, |EX-IO|, and |EX-TT| software instead of just generating an error

Are you struggling to figure out how to neatly run a myriad of cables around your layout to cater for dozens (or more) of sensors? Struggling to find ways to neatly integrate and hide sensors in and around your track? Well struggle no more, EX-SensorCAM is here!

Today, we are announcing a new Alpha product using embedded camera technology with the ESP32 CAM platform to visually monitor your layout and detect movements of trains to trigger events.

This can be used in place of traditional wired layout sensors with a camera placed overhead instead. This can then monitor activities on the layout, rather than having to figure out the best location for a sensor, then figure out how to mount or embed it in the track bed or surrounds, and then figure out a cunning way to hide it so it looks like part of the scenery. Not to mention removing the need to wire up every sensor and ensure that wiring is neat and tidy underneath the layout.

Like all our Alpha releases, this is very new software, meaning it's going to rapidly undergo many changes and bug fixes as issues are found, and functionality is likely going to change over time. This also means the project is currently aimed more towards our |tinkerer-text| and |engineer-text| audiences.

Like all our Alpha releases, this is very new software, meaning it’s going to rapidly undergo many changes and bug fixes as issues are found, and functionality is likely going to change over time. This also means the project is currently aimed more towards our 

There are some caveats on things like lighting requirements at the moment given the ESP32 CAM platform is a fairly low performance, entry-level device.

If you're keen to have a look and get started, then you can find the software in our `EX-SensorCAM repository <https://github.com/DCC-EX/EX-SensorCAM>`_ in GitHub, where you will find a PDF with instructions on what's required to get started.

If you’re keen to have a look and get started, then you can find the software in our 

`EX-SensorCAM repository <https://github.com/DCC-EX/EX-SensorCAM>`_

 in GitHub, where you will find a PDF with instructions on what’s required to get started.

You can also discuss this in the #ex-sensorcam channel in our `Discord Server <https://discord.gg/y2sB4Fp>`_.

announcing ex-sensorcam - a new camera-based sensor for your layout

The |DCC-EX| team is pleased to share the next Beta version of |EX-TT| with version 0.7.0 being released today. Please be aware that there are some changes in this version that may impact configuration options set, particularly for those using two wire stepper drivers such as the A4988, DRV8825, or TMC2208. Users with ULN2003 stepper drivers should not be impacted. **NOTE** If you are using the STEPPER_DRIVER option ``A4988_INV`` you will need to edit your configuration file, please see :ref:`ex-turntable/configure:stepper_driver` and :ref:`ex-turntable/configure:invert_enable` for more information.

 with version 0.7.0 being released today. Please be aware that there are some changes in this version that may impact configuration options set, particularly for those using two wire stepper drivers such as the A4988, DRV8825, or TMC2208. Users with ULN2003 stepper drivers should not be impacted. 

An often requested feature has been added in this release, enabling single direction rotation to cater for stepper motors and/or gearboxes that have a lot of slop. Refer to :ref:`ex-turntable/configure:rotate_forward_only` and :ref:`ex-turntable/configure:rotate_reverse_only` for more information on how to enable this.

An often requested feature has been added in this release, enabling single direction rotation to cater for stepper motors and/or gearboxes that have a lot of slop. Refer to 

In addition, the interactive serial console commands to |EX-TT| have been expanded significantly, allowing for various testing, debug, display, and other options to be enabled or disabled via the serial console. Note that the test move command ``<steps activity>`` has been altered also as a result. Refer to :ref:`ex-turntable/test-and-tune:ex-turntable interactive serial console commands` for the complete list of commands and what they do.

 have been expanded significantly, allowing for various testing, debug, display, and other options to be enabled or disabled via the serial console. Note that the test move command 

:ref:`ex-turntable/test-and-tune:ex-turntable interactive serial console commands`

Fix bug where enabling sensor testing or debug output prevents compiling

Add interactive serial command D to enable/disable debug output in serial console

Add interactive serial command E to erase calibration steps stored in EEPROM

Change movement command from <steps activity> to <M steps activity>

Add interactive serial command R to reset the EX-Turntable microcontroller

Add interactive serial command T to enable/disable sensor testing mode

Add interactive serial command V to display version and other system info

Add ability to force single direction rotation only for steppers with a lot of slop

Update AccelStepper library to v1.64 and remove need for modification

Enable inversion of direction, steps, and enable via config.h defines

The |DCC-EX| team is pleased to announce another new release of |EX-I| (version 0.0.18). As always, we encourage all users to download this new version of the installer to take advantage of the bug fixes and new features available.

 (version 0.0.18). As always, we encourage all users to download this new version of the installer to take advantage of the bug fixes and new features available.

The key updates in this release are support for the new options available in |EX-TT| version 0.7.0, and the ability to save the device logs from the Device Monitor screen directly within |EX-I|. This way, when interacting with the |DCC-EX| team in Discord or via either means, when asked to provide the startup logs or serial monitor logs, you can simply open Device Monitor and click the ``Save log`` button to obtain these.

The key updates in this release are support for the new options available in 

 version 0.7.0, and the ability to save the device logs from the Device Monitor screen directly within 

 team in Discord or via either means, when asked to provide the startup logs or serial monitor logs, you can simply open Device Monitor and click the 

Update a Python module version to resolve security vulnerabilities

Add a link to |DCC-EX| News articles about |EX-I| to the Info menu

Ensure the "Backup config files" popup is always launched within the app window geometry

Ensure the “Backup config files” popup is always launched within the app window geometry

Fix a bug where copying existing config files for |EX-TT| and |EX-IO| causes an exception

This has become a frequently asked question so we decided to create an article dedicated to the answer.

*Some users want to monitor how much current their locos are using and how close they may be to the limit set for their command station as they add more locos.*

Some users want to monitor how much current their locos are using and how close they may be to the limit set for their command station as they add more locos.

The short answer is that this should be a throttle function, or a task for an external device, not a command station function. Indeed, applications like |EX-TB| allow you to see track current virtually in real time.

The short answer is that this should be a throttle function, or a task for an external device, not a command station function. Indeed, applications like 

EX-CommandStation or to send commands to see the :doc:`current commands </reference/software/command-summary-consolidated>`

:doc:`current commands </reference/software/command-summary-consolidated>`

Use the |EX-TB| Android Phone/Table app with the :ref:`Current Meter Function <ex-toolbox/using:current meter>`

Use an external microcontroller with a display connected to the command station that sends commands via a serial port

Use an EXRAIL script to send the <JI> command based on a DELAY or button press and send that to a display

The current will change from microsecond to microsecond making a digital display impossible to read, you will have to perform your own averaging and conversion to a suitable display format (eg. a bar chart) but without using any floating point maths

The cost of updating the lcd on every loop will make the command station slow to respond to commands and track shorts

There may be up to 8 separate tracks for which current is being measured

Altering the base code is discouraged as it may be lost as updates are released, user modifications should be coded using the EXRAIL feature whenever possible.

DCC-EX, a global contributor to DCC open source software for model railroading, is proud to announce the second of our open source hardware products: the 

Third party ideas and products that work with EX-CommandStations. [DCC-EX is a team of dedicated enthusiasts producing, easy to use, affordable, do-it-yourself, open source, DCC solutions to allow you to run your complete model railroad layout.]

DCC-EX, a global contributor to DCC open source software for model railroading, is proud to announce the second of our open source hardware products: the |EX-CSB1| CommandStation and Booster, providing dual 5 amp |DCC| and |DC PWM| (pulse width modulation) output.

The |EX-CSB1| addresses the needs of DCC-EX users who want a ready-to-run DCC and DC CommandStation that will have them running trains within 5 minutes of plugging it into power and track.

 addresses the needs of DCC-EX users who want a ready-to-run DCC and DC CommandStation that will have them running trains within 5 minutes of plugging it into power and track.

With its built-in fast WiFi capability, up to 10 users can connect simultaneously using a phone or tablet in addition to commercially available throttles, in order to run trains and control their entire layout.

.. image:: /_static/images/ex-csb1/csb1_render_drop_shadow.png
   :alt: DCC-EX EX-CSB1

A DCC-EX Command Station can now outperform commercial DCC command stations which typically have single 3-3.5A or 5A output capabilities, and doing so at a fraction of the cost and with more advanced features.

The |EX-CSB1| is the  second offering in the DCC-EX open source hardware ecosystem specifically designed for model railroaders, and is a direct result of the strong community engagement DCC-EX strives to inspire.

 is the  second offering in the DCC-EX open source hardware ecosystem specifically designed for model railroaders, and is a direct result of the strong community engagement DCC-EX strives to inspire.

Featuring an ESP32 processor with built-in fast WiFi, and dual 5A output Texas Instruments MOSFET motor drivers, the EX-CSB1 features the same proven reliable output stage as the previous EX-MotorShield8874. The DRV8874 H-Bridge ICs also include hardware overcurrent protection monitored by EX-CommandStation, in addition to the existing software-based overload protection. It has a single 2.1mm barrel jack DC power for both the DCC/DC output and to supply the ESP32.

EX-CSB1 also allows stacking of the original |EX-MS| with zero hardware modifications to provide four DCC and |DC PWM| track outputs. Now users needing more power or more power districts have a strikingly simple upgrade path.

 track outputs. Now users needing more power or more power districts have a strikingly simple upgrade path.

EX-CSB1's exciting new feature is |Booster Mode|. Using the built-in Railsync compatible DCC input jack and a small piece of EXRAIL scripting, the EX-CSB1 can switch automatically into Booster mode to produce the same DCC output on any or all of up to 4 DCC outputs. Whilst in Booster mode, the EX-CSB1 can still respond to sensor inputs and perform EXRAIL animations as a remote animation node.

. Using the built-in Railsync compatible DCC input jack and a small piece of EXRAIL scripting, the EX-CSB1 can switch automatically into Booster mode to produce the same DCC output on any or all of up to 4 DCC outputs. Whilst in Booster mode, the EX-CSB1 can still respond to sensor inputs and perform EXRAIL animations as a remote animation node.

EX-CSB1 sports I2C support via an industry standard STEMMA QT/Qwiic connectors and pin headers making I2C bus connections easier than ever. The STEMMA QT/Qwiic ecosystem of I2C boards from Adafruit and Sparkfun are now the easiest I2C expansion boards to use. The DCC-EX team expects to add additional STEMMA QT/Qwiic based peripherals with model railroading friendly features in upcoming releases. An I2C SIP header is included to allow many I2C enabled OLED screens to plug directly into the board.

In addition, the |EX-CSB1-SHORT| expands on the proven EXRAIL automation and animation capabilities with even more memory for larger scripts to control locos, lighting, turnouts/points, servos, and virtually everything else on the layout.

 expands on the proven EXRAIL automation and animation capabilities with even more memory for larger scripts to control locos, lighting, turnouts/points, servos, and virtually everything else on the layout.

The EX-CSB1 is available immediately for purchase in the United States, the UK, Austria, Australia, New Zealand and South East Asia. Pricing starts at US$120 / AU$190 / £99 / €115 the DCC-EX store and resellers listed here:

This include firm is only for included documents
where the normal include files can't be included
again

.. |EXTERNAL-LINKxa| raw:: html

  <img src="https://dcc-ex.com/_static/images/external-link.svg" style="width: 16px; height: 16px; margin-top: -3px;">

<img src="https://dcc-ex.com/_static/images/external-link.svg" style="width: 16px; height: 16px; margin-top: -3px;">

.. image:: /_static/images/icons/flag_us60px.png
   :alt: USA Flag

`Smart Hobby, LLC <https://www.smarthobbyllc.com/>`_ |EXTERNAL-LINKxa|

.. image:: /_static/images/icons/flag_uk60px.jpg
   :alt: UK Flag

`Chesterfield Model Making and Miniature Electronics <https://chesterfield-models.co.uk/product-category/dcc-ex/>`_ |EXTERNAL-LINKxa|

`Chesterfield Model Making and Miniature Electronics <https://chesterfield-models.co.uk/product-category/dcc-ex/>`_

`ACI Model Railways <https://acimodelrailways.co.uk/>`_ |EXTERNAL-LINKxa|

.. image:: /_static/images/icons/flag_austria60px.png
   :alt: Austria Flag

`Model Railway Electronics powered by Semify <https://www.mrw-electronics.com/>`_ |EXTERNAL-LINKxa|

`Model Railway Electronics powered by Semify <https://www.mrw-electronics.com/>`_

.. image:: /_static/images/icons/flag_australia60px.png
   :alt: Australia Flag

`Millennium Engineering Pty Ltd <https://www.milleng.com.au>`_ |EXTERNAL-LINKxa|

`Buckambool Model Trains <https://bmodeltrains.com/product-category/dcc-ex-command-stations/>`_ |EXTERNAL-LINKxa|

`Buckambool Model Trains <https://bmodeltrains.com/product-category/dcc-ex-command-stations/>`_

Initial documentation is at: http://dcc-ex.com/ex-csb1/index with design files on the DCC-EX: Github https://github.com/DCC-EX/EX-CSB1 |EXTERNAL-LINK|.

In connection with the release of the EX-CSB1, version 5.0 of the EX-CommandStation is releasing with extended support for the EX-CSB1 and the entire suite of DCC-EX products.

DCC-EX would like to extend special thanks to team members Paul Antoine and Harald Barth for their ideas and contribution to the funding and design of the |EX-CSB1-SHORT| and engineer (head designer of the EX-MotorShield8874), Erwin Peterlin of Semify in Austria providing his time and design expertise.

DCC-EX would like to extend special thanks to team members Paul Antoine and Harald Barth for their ideas and contribution to the funding and design of the 

 and engineer (head designer of the EX-MotorShield8874), Erwin Peterlin of Semify in Austria providing his time and design expertise.

We have found that there are a small number of users who can have an issue when trying to update firmware or upload EXRAIL scripts to an EX-CSB1 Command Station (or any ESP32 based device). This seems to be an issue with some USB ports on some Windows machines, but no matter what operating system or computer you have (including a Raspberry Pi) please follow these instructions to fix the issue and report it to us along with what fixed it for you.

#1. **Make sure you have a CH340 driver installed** Windows does not come with CH340 support. If this is the first time you have tried to use a device with a CH340 chip, you need to install the driver as shown in :ref:`ex-commandstation/rtr-manual:Step 2: Install the Required USB Drivers`

 Windows does not come with CH340 support. If this is the first time you have tried to use a device with a CH340 chip, you need to install the driver as shown in 

:ref:`ex-commandstation/rtr-manual:Step 2: Install the Required USB Drivers`

ex-commandstation/rtr-manual:Step 2: Install the Required USB Drivers

#2. **Make sure you are connected to the correct com port** Some Windows machines can have a confusing array of com ports used internally, for Bluetooth, or for other connected devices. Check the Windows Device Manager to verify the port you select in the installer is the CH340 driver used by the CSB1. You can disconnect and reconnect the CSB1's USB cable and see the port disappear and re-appear. Here COM5 is the correct port:

 Some Windows machines can have a confusing array of com ports used internally, for Bluetooth, or for other connected devices. Check the Windows Device Manager to verify the port you select in the installer is the CH340 driver used by the CSB1. You can disconnect and reconnect the CSB1’s USB cable and see the port disappear and re-appear. Here COM5 is the correct port:

.. image:: /_static/images/ex-csb1/dev_mgr_com_ports.png
  :alt: Windows Device Manager COM Ports Image
  :scale: 70%
  :align: center

#3. **Try a different cable.** Our number one issue is dodgy cables. Some USB cables are “charging only” and do not have all the pins inside connected to be able to transmit data. Even if you have a data cable, try another one anyway, preferably not one of the exact same brand. We have seen a surprising number of poor quality or invisibly damaged cables.

 Our number one issue is dodgy cables. Some USB cables are “charging only” and do not have all the pins inside connected to be able to transmit data. Even if you have a data cable, try another one anyway, preferably not one of the exact same brand. We have seen a surprising number of poor quality or invisibly damaged cables.

#4.     **Try a different USB port.** If you have multiple USB ports on your computer, try a different one. In particular, we have seen USB 3.0 ports that did not work when a USB 2.0 did or visa versa.

 If you have multiple USB ports on your computer, try a different one. In particular, we have seen USB 3.0 ports that did not work when a USB 2.0 did or visa versa.

#5.     **Try a different computer.** Very few computers show the issue, so there is a good chance that if one computer does not work, a different one will. If you have a computer with a different operating system, like Linux or MacOS, give that a try.

 Very few computers show the issue, so there is a good chance that if one computer does not work, a different one will. If you have a computer with a different operating system, like Linux or MacOS, give that a try.

#6.     **Insert a capacitor into the RESET and GND header pins.** If the issue is not remedied by any of the previous solutions, then we can fix it by adding a capacitor between RESET and GND. Find a 1 to 10uF capacitor. Ceramic capacitors are not polarized. If you use a Tantalum or Electrolytic type, MAKE SURE TO USE THE CORRECT POLARITY. Note that on polarized capacitors, the positive leg is longer. There is also a "+" marking on Tantalum's and a stripe on the negative side for Electrolytics. The pins are clearly labeled on the underside of the CSB1 to help you identify RESET and GND. GND is negative.

 If the issue is not remedied by any of the previous solutions, then we can fix it by adding a capacitor between RESET and GND. Find a 1 to 10uF capacitor. Ceramic capacitors are not polarized. If you use a Tantalum or Electrolytic type, MAKE SURE TO USE THE CORRECT POLARITY. Note that on polarized capacitors, the positive leg is longer. There is also a “+” marking on Tantalum’s and a stripe on the negative side for Electrolytics. The pins are clearly labeled on the underside of the CSB1 to help you identify RESET and GND. GND is negative.

.. image:: /_static/images/ex-csb1/capacitors.png
  :alt: Capacitors
  :scale: 80%

Here is a capacitor inserted into the correct pins in the header. For a permanent install, the capacitor can be soldered under the board between Reset and the closest GND solder point.

.. image:: /_static/images/ex-csb1/capacitor_fix.png

We are currently testing some changes that may lead to an update in EX-Installer and/or the EX-CSB1 to compensate for the issue. We need to make sure any hardware change does not affect anything else. It would not be good to be able to upload and then find your nice, shiny, Command Station won’t reboot into operating mode. If you have the issue and are a Tinkerer or an Engineer, you may be able to help us since no one on the development team has a problem computer. You could be a valuable resource to help us beta test the best solution.

The |DCC-EX| team are excited to announce a new Production release of |EX-CS| with version 5.4.0 being made available today. As usual, this release includes a raft of **new features and enhancements** to bring even more capability and joy to your digital model railroading experience! We're also announcing changes to our **supported hardware platforms**.

 with version 5.4.0 being made available today. As usual, this release includes a raft of 

 to bring even more capability and joy to your digital model railroading experience! We’re also announcing changes to our 

Just check out this list of features and enhancements added since our last release:

Turntables can now be operated from throttles just like turnouts, including new |EX-R| commands for automation of turntable movement

Turntables can now be operated from throttles just like turnouts, including new 

Auto reverser and booster mode for the ESP32 platform is in Beta

Delay can be added to the startup of |EX-CS| to allow peripheral devices to boot or start first

Various HAL enhancements, including our native, non-blocking |I2C| capability for the STM32F4xx family of Nucleo platforms

Variable DC frequency support in TrackManager, using DCC function keys 29 - 31 to set the desired frequency whilst running

Various new ROUTE related commands - See :ref:`exrail/exrail-command-reference:scripts/sequences - types and control`

**JMRI_SENSOR(vpin [,count])** - creates <s> type sensors visible to jmri

Blinking/flashing vpin and amber signal - **BLINK( pin, onms, offms )** - blink an output pin

New **ONBUTTON( vpin )** - event handler for debounced button presses and **ONSENSOR( sensor_id )** - event handler for sensors

Compile time checks for:
 - duplicate or missing automation/route IDs
 - LATCH and RESERVE IDs out of range
 - speeds out of range

- duplicate or missing automation/route IDs
- LATCH and RESERVE IDs out of range
- speeds out of range

We continue to recommend the tried and true Arduino Mega2560 as our preferred and recommended hardware platform for |EX-CS|, with the Uno and Nano backing it up as alternatives, albeit with less I/O and resources available compared with the Mega2560. We have seen some quality issues with the cheaper end of the clone variants of these boards. In general genuine Arduino and Elegoo clones remain our recommendations, but the genuine Arduino Mega is quite expensive given its performance.

We continue to recommend the tried and true Arduino Mega2560 as our preferred and recommended hardware platform for 

, with the Uno and Nano backing it up as alternatives, albeit with less I/O and resources available compared with the Mega2560. We have seen some quality issues with the cheaper end of the clone variants of these boards. In general genuine Arduino and Elegoo clones remain our recommendations, but the genuine Arduino Mega is quite expensive given its performance.

Along with our :doc:`/news/posts/20230807` announcement back in August 2023, we also announced some new Beta hardware platforms including the ESP32-WROOM and select STMicroelectronics Nucleo STM32F4xx family boards. These boards are now largely moving into full support as they have proven to be reliable and provide a lot more "bang for your buck" in terms of capabilities and future proofing your |EX-CS| with the continuing new features being added.

 announcement back in August 2023, we also announced some new Beta hardware platforms including the ESP32-WROOM and select STMicroelectronics Nucleo STM32F4xx family boards. These boards are now largely moving into full support as they have proven to be reliable and provide a lot more “bang for your buck” in terms of capabilities and future proofing your 

Moving forwards, we **highly recommend new users seriously consider these newer, more powerful ESP32 or Nucleo boards** as the pricing is competitive even compared with clone Mega2560 options, and as they have much more RAM they will scale to be able to animate and automate much larger layouts and allow you to keep up with the development of the |DCC-EX| ecosystem.

**highly recommend new users seriously consider these newer, more powerful ESP32 or Nucleo boards**

highly recommend new users seriously consider these newer, more powerful ESP32 or Nucleo boards

 as the pricing is competitive even compared with clone Mega2560 options, and as they have much more RAM they will scale to be able to animate and automate much larger layouts and allow you to keep up with the development of the 

The **Arduino UNO and Nano**, however, are **no longer recommended** as fully capable platforms as they are just too limited in terms of RAM and FLASH resources and capability to fit all of the |DCC-EX| feature set. They therefore will not work with some of our newest features such as :doc:`/trackmanager/index` or |I2C| connectivity. |DCC-EX| does allow users to turn off features such that UNOs and Nanos can still be handy as dedicated programming only devices with |JMRi| or for simple Christmas layouts of course, but don't expect to be using any of our newest or resource hungry features on these devices. They can also be re-purposed as versatile and affordable |I2C| accessory devices with our new |EX-IO|, as they can provide a mix of digital GPIO, PWM output, and analog inputs on a single board.

 as fully capable platforms as they are just too limited in terms of RAM and FLASH resources and capability to fit all of the 

 feature set. They therefore will not work with some of our newest features such as 

 does allow users to turn off features such that UNOs and Nanos can still be handy as dedicated programming only devices with 

 or for simple Christmas layouts of course, but don’t expect to be using any of our newest or resource hungry features on these devices. They can also be re-purposed as versatile and affordable 

, as they can provide a mix of digital GPIO, PWM output, and analog inputs on a single board.

We now have a larger number of core platforms to support so need to rationalise our support of some legacy platforms. Also, a number of previously supported platforms are no longer available to the primary |DCC-EX| team for testing and validation. As a result, we are announcing the **deprecation of support for some platforms**, and these will no longer function with |EX-CS| when we release our next major version 6.0.0. Support for these right now is limited to ensuring the software compiles, as no testing is possible by the team.

We now have a larger number of core platforms to support so need to rationalise our support of some legacy platforms. Also, a number of previously supported platforms are no longer available to the primary 

 team for testing and validation. As a result, we are announcing the 

 when we release our next major version 6.0.0. Support for these right now is limited to ensuring the software compiles, as no testing is possible by the team.

Read below for a summary of the changes to our supported hardware platforms.

New users should choose one of these platforms to make use of all features and capabilities.

:doc:`/reference/hardware/microcontrollers/arduino-mega` genuine Arduino Mega 2560 R3, and good quality clones - continues as supported and recommended, but RAM is limited for large layouts with lots of accessories and/or animations or automations

 genuine Arduino Mega 2560 R3, and good quality clones - continues as supported and recommended, but RAM is limited for large layouts with lots of accessories and/or animations or automations

(link to new page here) ESP32 moves from Beta into full support - note this is for devices using the **ESP32-WROOM (ESP32-D0WD) CPU only**, other ESP32 variants such as C3, S3, etc. are not supported at this time and may never be due to hardware limitations

(link to new page here) ESP32 moves from Beta into full support - note this is for devices using the 

, other ESP32 variants such as C3, S3, etc. are not supported at this time and may never be due to hardware limitations

(link to new page here) STMicroelectronics Nucleo boards in the STM32F4xx family move from Beta into full support for DCC only - note that DC mode and Ethernet support for these is still in Beta

No new features will be available for these, but they can still be handy for dedicated programming or small demo layouts. Note that an ESPduino32 has the same format as an Uno, is probably less expensive, and has full capabilities including WiFi.

The team no longer has hardware to test these boards, so we ensure the software compiles for them only, and no testing is performed. They will be removed when we release 6.0.0.

Given there are a lot of |DCC-EX| users who also utilise |JMRi|, we figured it was worthwhile outlining some more specific updates centred around |JMRi| and the interoperability with it.

, we figured it was worthwhile outlining some more specific updates centred around 

Note these all require |JMRi| v5.7 or later AND |DCC-EX| v5.4.0 or later.

'Roster Export to DCC-EX' - the ability to press a button and have your complete |JMRi| Engine Roster shown in a window which you can then copy into your DCC-EX Roster

‘Roster Export to DCC-EX’ - the ability to press a button and have your complete 

 Engine Roster shown in a window which you can then copy into your DCC-EX Roster

|DCC-EX| 'Virtual LCD Displays' on |JMRi| to see data about your |EX-CS| and additional user data without having to have physical LCDs or OLEDs connected to your command station

 and additional user data without having to have physical LCDs or OLEDs connected to your command station

Monitor, Send Command, and Config Base Station now multi-connection-aware

Config Base Station now available as Startup action in Preferences

New 'Open Meter' pane in Preferences -> Set Up -> Add -> Perform action -> 'Open Meters'

New ‘Open Meter’ pane in Preferences -> Set Up -> Add -> Perform action -> ‘Open Meters’

DCC++ Current Meter now automatically tracks & displays active current draw on Main A

Sample script (SendDCCppMessages.py) to easily send DCCpp commmands to run |EX-R| scripts directly from |JMRi|

Sample script (SendDCCppMessages.py) to easily send DCCpp commmands to run 

Automatic population of the |JMRi| Sensor pane by using the new |EX-R| JMRI_SENSOR function

We've released the latest version of the |DCC-EXP| library version 1.2.0 today.

This release adds the ability to read/write CVs on both the main and programming tracks:

handOffLoco(locoAddress, automationId)

- Use this to send a loco to an EXRAIL automation.
- You must enable retrieving routes, and the automationId must match a valid EXRAIL automation ID to work.

You must enable retrieving routes, and the automationId must match a valid EXRAIL automation ID to work.

readCV(cv) and validateCV(cv, value)

- Read or validate a CV for a loco on the programming track.
- The associated delegate method to implement is receivedValidateCV(int cv, int value) as both return the same response.

The associated delegate method to implement is receivedValidateCV(int cv, int value) as both return the same response.

writeLocoAddress(address)

- Write the provided address to a loco on the programming track.
- The associated delegate method to implement is receivedWriteLoco(int address).

The associated delegate method to implement is receivedWriteLoco(int address).

validateCVBit(cv, bit, value)

- Validate the specified bit of a CV for a loco on the programming track.
- The associated delegate method to implement is receivedValidateCVBit(int cv, int bit, int value).

Validate the specified bit of a CV for a loco on the programming track.

The associated delegate method to implement is receivedValidateCVBit(int cv, int bit, int value).

writeCV(cv, value)

- Write a CV to a loco on the programming track.
- The associated delegate method to implement is receivedWriteCV(int cv, int value).

The associated delegate method to implement is receivedWriteCV(int cv, int value).

writeCVBit(cv, bit, value)

- Write the specified value to the specified bit of a CV to a loco on the programming track.
- There is no delegate method to implement for the response for this due to parser limitations, and we recommend writing full CVs.

Write the specified value to the specified bit of a CV to a loco on the programming track.

There is no delegate method to implement for the response for this due to parser limitations, and we recommend writing full CVs.

writeCVOnMain(address, cv, value)

- Write to the specified CV to the specified loco on the main track.

Write to the specified CV to the specified loco on the main track.

writeCVBitOnMain(address, cv, bit, value)

- Write to the specified bit and CV to the specified loco on the main track.

Write to the specified bit and CV to the specified loco on the main track.