SET ENGINE THROTTLES USING 128-STEP SPEED CONTROL
<t REGISTER CAB SPEED DIRECTION [TRACK] [DELAY]>
sets the throttle for a given register/cab combination
- REGISTER: an internal register number, from 1 through MAX_MAIN_REGISTERS (inclusive), to store the DCC packet used to control this throttle setting
- CAB: short (1 - 127) or long (128-10293) address of the engine decoder
- SPEED: throttle speed from 0-126, or -1 for emergency stop (resets SPEED to 0)
- DIRECTION: 1=forward, 0=reverse. Setting direction when speed=0 or speed=-1 only effects directionality of cab lighting for a stopped train
- [TRACK]: track # (0=both, 1=main, 2=prog). Defaults to main track when not specified.
- [DELAY]: delay in (s) before chaning speed. Note: must also specify [TRACK].
returns: <T REGISTER SPEED DIRECTION>
OPERATE ENGINE DECODER FUNCTIONS F0-F28
<f CAB BYTE1 [BYTE2]>
<f -1 REGISTER CAB BYTE1 [BYTE2]>
<f -2 REGISTER CAB FN TOGGLE [TRACK]>
turns on and off engine decoder functions F0-F28 (F0 is sometimes called FL) NOTE: setting requests transmitted directly to mobile engine decoder — current state of engine functions is not stored by this program
- REGISTER: an internal register number, from 1 through MAX_MAIN_REGISTERS (inclusive), to store the DCC packet used to control these functions.
- REGISTER is only used if the first argument is -1 or -2
- CAB: the short (1-127) or long (128-10293) address of the engine decoder
- FN: the FN number (0-28)
- TOGGLE:
- 1 = Toggle FN 'ON' (set corresponding bit on)
- 0 = Toggle FN 'OFF' (set corresonding bit off)
- [TRACK]: track #
- 0=both
- 1=main (default when not specified)
- 2=prog
- BYTE1 and BYTE2
- To set functions F0-F4 on (=1) or off (=0):
- BYTE1: 128 + F1*1 + F2*2 + F3*4 + F4*8 + F0*16
- BYTE2: omitted
- To set functions F5-F8 on (=1) or off (=0):
- BYTE1: 176 + F5*1 + F6*2 + F7*4 + F8*8
- BYTE2: omitted
- To set functions F9-F12 on (=1) or off (=0):
- BYTE1: 160 + F9*1 +F10*2 + F11*4 + F12*8
- BYTE2: omitted
- To set functions F13-F20 on (=1) or off (=0):
- BYTE1: 222
- BYTE2: F13*1 + F14*2 + F15*4 + F16*8 + F17*16 + F18*32 + F19*64 + F20*128
- To set functions F21-F28 on (=1) of off (=0):
- BYTE1: 223
- BYTE2: F21*1 + F22*2 + F23*4 + F24*8 + F25*16 + F26*32 + F27*64 + F28*128
returns: NONE
TURN ON POWER FROM MOTOR SHIELD TO TRACKS
<1 [TRACK]>
enables power from the motor shield to the main operations and programming tracks
- [TRACK]: optionally specify track number; 1=main, 2=prog. When not specified, enable power to both tracks.
returns: <p1>
TURN OFF POWER FROM MOTOR SHIELD TO TRACKS
<0 [TRACK]>
disables power from the motor shield to the main operations and programming tracks
- [TRACK]: optionally specify track number; 1=main, 2=prog. When not specified, disables power to both tracks.
returns: <p0>