Shift Lights

Summary

This controller allows to control one or multiple shift lights that indicates when to shift based on engine RPM.

It allows to set-up multiple steps, which will light up progressively as the engine gets closer to maximum RPM.


File Info

Filename shiftLights.lua
Path /lua/vehicle/controller/shiftLights.lua
Type Auxiliary
Usage type Multiple

JBeam Properties

number
type
3000
default
The RPM range over which the controller will interpolate the different steps.
The controller will start activating lights when the RPM reaches maxRPM-rpmRange.
string
type
Name of the engine
Required for the stall warning, and automatic calculation of the maxRPM.
number
type
Offsets the engine’s maxRPM when automatically calculating the shiftlight’s maxRPM
Allows to activate the shiftlight’s blinking slightly before the redline.
boolean
type
false
default
If the controller will indicate if the engine is stalled.
number
type
engine maxRPM
default
RPM at which the shiftlights will flash.
number
type
The minimum RPM at which the controller will start activating lights.
This overwrites rpmRange.
string
type
rpm
default
Name of the electrics used to control the shiftlights
boolean
type
true
default
Keeps the LEDs of the previous stages on.
If set to false. Only the light associated to the current shiftlight stage will be lit up.
number
type
0.1
default
Duration of the flashing cycle in seconds.
array
type
List of electrics which will be controlled by the controller.

The number of electrics will define the number of stages. The various electrics will light up in the order they are defined.

"outputElectrics": ["led0", "led1", "led2", "led3", "led4", "led5", "led6", "led7"],
array
type
List of electrics which will blink when maxRPM has been reached.
array
type
Secondary set of electrics which will blink when maxRPM has been reached.
These will have their flashing cycle offset from the flashingOutputElectrics. They will be on when flashingOutputElectrics are off, and vice-versa.


Example Usage

Single stage shiftlight.

"controller": [
    ["fileName"],
    ["shiftLights"],
],
"shiftLights": {
    "engineName":"mainEngine",
    "maxEngineRPMOffset": 400,
    "rpmRange": 1000,
    "outputElectrics": ["led"],
    "flashingOutputElectrics": ["led"],
},

Shiftlight with 7 stages, with the last two flashing when hitting the rev limiter.

"controller": [
    ["fileName"],
    ["shiftLights"],
],
"shiftLights": {
    "engineName":"mainEngine",
    "maxEngineRPMOffset": 400,
    "rpmRange": 3000,
    "keepLEDsActive": true,
    "hasStallWarning": true,
    "outputElectrics": ["led0", "led1", "led2", "led3", "led4", "led5", "led6", "led7"],
    "flashingOutputElectrics": ["led6", "led7"],
    "flashingAlternateOutputElectrics": [],
},

Last modified: December 18, 2021

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.