RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 1
ShiftX2 Only half the lights work
Author Message
Reply with quote
Post ShiftX2 Only half the lights work 
Only the left three of the shift lights are working on ours. The right half of the lights don't turn on. Any idea what we could have done wrong. Below is my script.

Code:
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
[/code]

View user's profile Send private message
Reply with quote
Post  
It looks to me like because you are using stepped style, you set the number of LEDs in the sxSetLinearThresh to 0 for each threshold, you probably only get one (or two because centered) light per threshold. I would first change the number of LEDs per threshold to something non-zero. You can define up to 5 thresholds (0-4), but you only define 3 (0-2).

Since it isn't working, you might want to assign the result of the various sxXXXX() functions to a value that you print in the log. I think this would give you an idea if you are passing bad parameters to the interface.

To rule out a hardware issue -- do all the lights turn on when the ShiftX3 is powered up, and no CAN messages sent?


_________________
David Ferguson
Veracity Racing Data
Autosport Labs Preferred Dealer
https://veracitydata.com
View user's profile Send private message Visit poster's website
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum