Code: Select all
setTickRate(25)
-- Set ShiftX2 configuration parameters with default parameters
-- orientation: 0=normal, 1=inverted (display above LED bar)
-- brightness: 0-100%, 0 = auto brightness
-- can bus: 0=CAN1, 1=CAN2
-- CAN base address: Default: 931328
-- Auto brightness scaling: 0-255; Default: 51
-- Enable / Disable button events
sxSetConfig(0,0,1,931328,51,true)
--config shift light
sxCfgLinearGraph(1,1,0,6500) --center graph, stepped style, 0 - 6500 RPM range
sxSetLinearThresh(0,0,4000,0,255,0,0) --green at 3000 RPM
sxSetLinearThresh(1,0,5500,255,255,0,0) --yellow at 5000 RPM
sxSetLinearThresh(2,0,6500,255,0,0,10) --red+flash at 6000 RPM
--configure first alert (right LED) as engine temperature (F)
sxSetAlertThresh(0,0,205,255,255,0,0) --yellow warning at 205F
sxSetAlertThresh(0,1,225,255,0,0,10) -- red flash at 225F
--configure second alert (left LED) as oil pressure (PSI)
sxSetAlertThresh(1,0,0,0,0,255,10) --red flash below 15 psi
sxSetAlertThresh(1,1,15,255,255,0,5) --yellow flash 15-20 PSI
sxSetAlertThresh(1,2,20,0,0,0,0) --above 20, no alert
function shiftLight()
--update RPM
sxUpdateLinearGraph(getChannel("RPM"))
--update engine temp alert
sxUpdateAlert(0, getChannel("EngineTemp"))
--update oil pressure alert
sxUpdateAlert(1, getChannel("OilPress"))
end
function onTick()
collectgarbage()
shiftLight()
end