--activate LEDs
if rpm > 8000 then return end --this filters out RPM spikes
if rpm > 6600 then setGpio(2,1) else setGpio(2,0) end
if rpm > 7000 then setGpio(1,1) else setGpio(1,0) end
if rpm > 7400 then setGpio(0,1) else setGpio(0,0) end
end

Thu Apr 28, 2016 2:09 am

Ash-b-84

Joined: 28 Aug 2015
Posts: 14

Could I ad in a line

If rpm > 7400 toggle Gpio (2,1) (1,1) (0,1) end

Thu Apr 28, 2016 2:17 am

stieg

Joined: 20 Dec 2013
Posts: 101
Location: Madison, WI

Code:

If rpm > 7400 toggle Gpio (2,1) (1,1) (0,1) end

I don't believe that is valid Lua. If you broke it up into 3 calls, then yes. Feel free to use this script.

Quote:

What is meant by 3 calls I am a complete novice

If you intend to edit the scripts then it would be wise to jump into Lua a bit first to get an idea of what is happening. Here is a free tutorial provided by the folks who wrote LUA: https://www.lua.org/pil/contents.html#1. I would suggest you merely adjust the numbers in the checkRpm function in the script provided rather than try to add to it. Trying to jump straight in and do larger edits without experience will lead to lots of frustration, and that is no fun.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou cannot download files in this forum