EX-RAIL

Editing myAutomation.h

Suitable For Level: Conductor Hat Propeller Beanie Engineer Hat

The instructions containing all your objects and sequences is added to your EX‑CommandStation by creating a file called myAutomation.h in the same folder as ‘CommandStation-EX.ino’.

Connecting your Arduino and pressing the Upload button in the usual way will save the file and upload your script into the Command Station.

You can create and edit the myAutomation.h using a text editor (like Notepad), but if you are using the Arduino IDE (rather than the EX‑Installer) you can create the myAutomation.h file in the Arduino IDE. Use the pulldown button and select New Tab (or simply press Ctrl+Shift+N).

Setup pulldown button Setup pulldown menu

Enter the file name “myAutomation.h” (This is case sensitive)

Setup myAutomation.h

And type your script in.

Setup Example file

Content

What you will need to add to your myAutomation.h` file will be explained in the next few pages, but can be categorised as:


Re-upload the EX-CommandStation software

Using EX-Installer

Warning

If you are using EX‑Installer DO NOT create or edit the myAutomation.h file in the EX-Installer installation folder (the folder the EX-Installer creates).

Instead, create you myAutomation.h anywhere else and point EX-Installer to that folder when it askes.

  1. create your ‘myAutomation.h’ file in any CommandStation-EX, anywhere on your computer (except the EX-Installer installation folder.)

  2. Run EX‑Installer

  3. When asked, point EX-Installer to the folder and file that you created.

The myAutomation.h file will be automatically loaded with the EX‑CommandStation software.

See Managing config files with the Installer for more information.


Using the Arduino IDE

  1. Place your ‘myAutomation.h’ file in the CommandStation-EX subfolder of wherever you extracted the EX‑CommandStation files from GitHub.

  2. Run the Arduino IDE

  3. Open the CommandStation-EX folder

  4. Select the Board, COM port etc. as before

  5. click Upload

The myAutomation.h file will be automatically loaded with the EX‑CommandStation software.


Next Steps - Objects

See the Objects - an Introduction page or click the ‘Next’ button to learn how to add the key objects you will need to create your automation sequences.