When you flip a function switch “ON,” the function number will be displayed like this:
Figure 11. Operating Loco Functions 0,1,3,4,and 5 ON
Step 9. Special Operations
Direction Neutral (Center Off): When the direction switch is set to center off during normal operation, then the speed control know will be ignored, and the last known speed sent to JMRI will be displayed. If you change the speed setting while in Neutral, then set the Direction to either FWD or REV, the current knob setting will be sent to JMRI as the new speed setting.
Changing addresses: Even if you are using this throttle for a young visitor, you may want to change the address of the throttle occasionally, without having to re-program the ESP32. This can easily be done with the following sequence:
1. Start with the throttle powered off and the Direction switch set to center off.
2. Push and hold down the push button normally used for F2, then power the throttle on.
3. Release the push button and the screen should blink: “SET ADDR?” with the last address set displayed.
4. Set the Direction switch to increment up (FWD) or down (REV) and push the button to change the address.
5. When done setting the address, release the button, place the Direction switch to center off, and hold the button down for one second. The new address is saved and you can start running the loco at this address.
Turning DCC Power ON: Before you release the button in the previous step, and after placing the Direction switch in the center off position, if you flip all function switch up (ON), then when you release the button the command will be sent to JMRI to turn on DCC power. This is not something one would normally expect a novice user to do on his/her/its throttle but it is provided here for your convenience
If you are not changing the loco address, then:
1. Before powering on
2. Set the Direction switch to center off
3. Turn all function switches up (ON)
4. Turn Power On or connect your battery
The command will be sent to JMRI to turn on DCC power.
Step 9: Changing your throttle configuration
You can change your throttle to work with any JMRI WiFi server.
Near the beginning of the sketch you loaded into your ESP32 you will find the statements:
// WiFi Server Definitions
const char* ssid = "model-rr";
const char* password = "model-rr";
const char* host = "192.168.6.1";
const int tpPort = 12090;
With the Arduino editor you can change the name (ssid) of the WiFi server, the password to access the server, the server’s network (IP) address, and the Port number for the server access. When you edit them be sure to change only what is between the double quote marks (“ “).
You can also limit the number of Function switches that can be used by the throttle from 1-8 by changing the “6” in the statement:
int num_functions = 6; // Number of functions supported by this throttle UP TO 8 MAX
You can also change the switch/button assignments to their respective functions by changing:
#define F0_pin TA // Function 0 pin assignment
#define F1_pin TB // Function 1 pin assignment
#define F2_pin PB // Function 2 pin assignment
#define F3_pin TC // Function 3 pin assignment
#define F4_pin TD // Function 4 pin assignment
#define F5_pin TE // Function 5 pin assignment
#define F6_pin TF // Function 5 pin assignment
#define F7_pin TG // Function 5 pin assignment
You can see the pins assigned to each label here:
#define PB 26 // Pushbotton Active LOW usually assigned to F2
#define TA 2 // SPDT toggle active HIGH
#define TB 4 // SPDT toggle active HIGH
#define TC 5 // SPDT toggle active HIGH
#define TD 12 // SPDT toggle active HIGH
#define TE 13 // SPDT toggle active HIGH
#define TF 14 // SPDT toggle active HIGH
#define TG 15 // SPDT toggle active HIGH
This gives you the ability to assign the push button to a different function, and to rearrange the order of all functions any way you want. You could even implement a sequence of DCC commands, (like taking up coupler slack, stopping, backing pausing and forward for uncoupling moves, etc.) and even "side animation sequences" to alternate decoder addresses at switch or button command.
There are many more variations you can build into your throttle. This article should get you started on a whole series of new adventures in model railroading, quickly, and for relatively low cost!
Appropriate questions, comments, and suggestions are always welcome.
Have fun!
Best regards,
Geoff Bunza