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.
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.
This overwrites rpmRange.
If set to false. Only the light associated to the current shiftlight stage will be lit up.
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": [],
},