Script for a more stable shiftX light

Discussion on the Lua Scripting capabilities for RaceCapture/Pro. Also see the <a href="">Lua Scripting Guide</a>

Moderators: JeffC, stieg

Post Reply
Posts: 9
Joined: Mon Oct 07, 2013 4:03 pm

Script for a more stable shiftX light

Post by stingg »

Found that the basic script especially at high rpm is not stable and the light jump to and from the cutoff point. Below script gives a more stable shift light by averaging the rpm and having different on-rpm and off-rpm.

a = 0
y = 0
function onTick()
if getGpsSpeed() > 10 then startLogging() end
local r = getTimerRpm(2)
a = (r+y)/2
if a > 7200 then setGpio(0,1) elseif a < 7000 then setGpio(0,0) end
if a > 7700 then setGpio(1,1) elseif a < 7500 then setGpio(1,0) end
if a > 8200 then setGpio(2,1) elseif a < 8000 then setGpio(2,0) end
y = r


Site Admin
Posts: 5986
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Thanks for the script - are you saying that right at the RPM threshold between 'steps' it jumps?

How stable is your RPM reading while monitoring it in the dashboard?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply