Auto Logging using increased RPM

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

Moderators: JeffC, stieg

Post Reply
Dirty Deeds
Posts: 15
Joined: Mon Jun 20, 2016 10:31 pm
Location: Australia
Contact:

Auto Logging using increased RPM

Post by Dirty Deeds »

Hi Guys,
I currently have Lua Script entered to auto-log using GPS speed. I'd like to change this & start auto-logging when the engine starts using over 500 RPM. I'm wondering how you delete the old script (do you just delete & rewrite on the app?) & can any tech experts let me know if the below script should work (using the RPM1 input)? Cheers!

function onTick()
if getTimerRpm() > 500 then
startLogging()
else
stopLogging()
end
end
Attachments
Screen Shot 2016-06-24 at 8.46.34 am.png
Screen Shot 2016-06-24 at 8.46.34 am.png (206.84 KiB) Viewed 1444 times
Get in, Hold on , Shut up & pass me my Beer!

rdoherty
Posts: 215
Joined: Fri Mar 08, 2013 3:32 am

Post by rdoherty »

For your script you want to give the getTimerRpm() function the channel #. If you hooked your RPM into the first RPM input, then you would use getTimerRpm(0). Hope that helps!
Ryan Doherty
Autosports Labs

Dirty Deeds
Posts: 15
Joined: Mon Jun 20, 2016 10:31 pm
Location: Australia
Contact:

Post by Dirty Deeds »

rdoherty wrote:For your script you want to give the getTimerRpm() function the channel #. If you hooked your RPM into the first RPM input, then you would use getTimerRpm(0). Hope that helps!
Thanks - I'll try this & post how I go & the new script I used - boats in bits atm so may take few days - thanks for the input&#128077;
Get in, Hold on , Shut up & pass me my Beer!

Dirty Deeds
Posts: 15
Joined: Mon Jun 20, 2016 10:31 pm
Location: Australia
Contact:

Post by Dirty Deeds »

Great - that worked, the script I used was:

function onTick()
if getTimerRpm(0) > 1000 then
startLogging()
else
stopLogging()
end
end

Thanks for the help!
Get in, Hold on , Shut up & pass me my Beer!

rdoherty
Posts: 215
Joined: Fri Mar 08, 2013 3:32 am

Post by rdoherty »

Awesome!
Ryan Doherty
Autosports Labs

Post Reply