RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 1
Cannot get shift x to work
Author Message
Reply with quote
Post Cannot get shift x to work 
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

View user's profile Send private message
Reply with quote
Post  
Also when 12v car power Is first turned on an the rcp gets power all the leds on the shift x light up at the same time for a second then go off but will not come on at any rpm

View user's profile Send private message
Reply with quote
Post  
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

View user's profile Send private message
Reply with quote
Post  
Hi Ash,

Can you post your lua script so we can review further?

Also, are you getting RPM from the RPM connection on RaceCapture/Pro?


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
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

View user's profile Send private message
Reply with quote
Post  
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:




Code:

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




_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
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

View user's profile Send private message
Reply with quote
Post  
Hi,

Great - glad you got it working!


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Beet is there a way I can input a line to say for no more than 7200 rpm turn all LEDs off that way if it does spike higher it won't throw the lights on ?

View user's profile Send private message
Reply with quote
Post  
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:


Code:

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


See if this makes a difference.

View user's profile Send private message Send e-mail
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