Hi I have the mk1 I have set the gpio jumpers to out position
Set the digital in/out to outputs 10hz in race capture
Copied an pasted the pula script off the website but changed rpm values
But nothing happens to the lights on the shift x
My rpm is displayed on the rpm2 channel not rpm is there anything else I need to change as getting quite frustrated
Many thanks in advance
Cannot get shift x to work
Did you change the script so it is using your RPM input and not the test value?
function ctON(ul,ll)
--RPM=getTimerRpm(0) <-- Remove '--'
RPM=testRPM <-- Remove this line
factor = 0.5 * FREQ_HZ * (1 - (ul - RPM) / (ul - ll))
if factor >= 0.5 * FREQ_HZ then --can't blink faster than tickRate/2--
on_time = MAX_ON_TIME
elseif factor < 1 then --can't blink slower than max period--
on_time = 0
else
on_time = MAX_ON_TIME / factor
end
return on_time / loop_time
end
function ctON(ul,ll)
--RPM=getTimerRpm(0) <-- Remove '--'
RPM=testRPM <-- Remove this line
factor = 0.5 * FREQ_HZ * (1 - (ul - RPM) / (ul - ll))
if factor >= 0.5 * FREQ_HZ then --can't blink faster than tickRate/2--
on_time = MAX_ON_TIME
elseif factor < 1 then --can't blink slower than max period--
on_time = 0
else
on_time = MAX_ON_TIME / factor
end
return on_time / loop_time
end
function onTick() end
setTickRate(15) --15Hz
--Shift Now!!!!
function onTick()
rpm=getTimerRpm(0) --read RPM
--activate LEDs
if rpm > 6600 then setGpio(2,1) else setGpio(2,0) end
if rpm > 6900 then setGpio(1,1) else setGpio(1,0) end
if rpm > 7200 then setGpio(0,1) else setGpio(0,0) end
end
that's what I have my rpm comes from rpm2 when I check the dashboard in racecapture
setTickRate(15) --15Hz
--Shift Now!!!!
function onTick()
rpm=getTimerRpm(0) --read RPM
--activate LEDs
if rpm > 6600 then setGpio(2,1) else setGpio(2,0) end
if rpm > 6900 then setGpio(1,1) else setGpio(1,0) end
if rpm > 7200 then setGpio(0,1) else setGpio(0,0) end
end
that's what I have my rpm comes from rpm2 when I check the dashboard in racecapture
Hi,
The line:
rpm=getTimerRpm(0) --read RPM
means 'get RPM from the first timer input port'
0 = first port
1 = second port
2 = third port
When facing the terminal block, the right most port is 0, then 1 and two towards the middle.
If you have it hooked up to the 3rd port, then you'll have to make this line:
rpm=getTimerRpm(2) --read RPM
Also,
you have onTick() listed twice in the script. It should only be defined once.
Here's an updated script. Let us know if this works:
The line:
rpm=getTimerRpm(0) --read RPM
means 'get RPM from the first timer input port'
0 = first port
1 = second port
2 = third port
When facing the terminal block, the right most port is 0, then 1 and two towards the middle.
If you have it hooked up to the 3rd port, then you'll have to make this line:
rpm=getTimerRpm(2) --read RPM
Also,
you have onTick() listed twice in the script. It should only be defined once.
Here's an updated script. Let us know if this works:
Code: Select all
setTickRate(15) --15Hz
--Shift Now!!!!
function onTick()
rpm=getTimerRpm(2) --read RPM
--activate LEDs
if rpm > 6600 then setGpio(2,1) else setGpio(2,0) end
if rpm > 6900 then setGpio(1,1) else setGpio(1,0) end
if rpm > 7200 then setGpio(0,1) else setGpio(0,0) end
end
Managed to get it workin now changed it to output (1) however at set rpm both the amber an green come on at the same time an also I'm still gettin spikes when revved where it will read over 40000rpm for a split second throwing the lights on etc seems more stable when rpm is raised slowly so maybe better under load
The best way is to actually filter the RPM signal at the source, but if that is not practical or possible then you can possibly apply a band-aid solution, like this:
See if this makes a difference.
Code: Select all
setTickRate(15) --15Hz
--Shift Now!!!!
function onTick()
rpm=getTimerRpm(2) --read RPM
--activate LEDs
if rpm > 15000 then return end --this filters out RPM spikes
if rpm > 6600 then setGpio(2,1) else setGpio(2,0) end
if rpm > 6900 then setGpio(1,1) else setGpio(1,0) end
if rpm > 7200 then setGpio(0,1) else setGpio(0,0) end
end