RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 1
Virtual Channel help please
Author Message
Reply with quote
Post Virtual Channel help please 
I'm trying to create a virtual channel called "StintTime" to serve as a driver stint timer. I'm attempting to pull the getUptime() command to pull the time the unit has been powered up (divided by 60,000 to convert to minutes). This is my first time I've tried creating a Virtual Channel so naturally I'm screwing it up. Does anyone have an idea what the trouble may be? RCP3 on 2.14.0

timerId = addChannel(“StintTime”,1,0,0,250,”min”)

function drivetime()
local time = getUptime()/60000
setChannel(timerId, time)
end

setTickRate(30)
function onTick()
drivetime()
end

[lua] Startup script error: ([string "timerId = addChannel( 201cStintTime 201d,1,0,0,250, 201dmin 201..."]:1.0: malformed number near '201cStintTime')
[lua] Failure: Failed to load script

View user's profile Send private message
Reply with quote
Post  
Check the double quote characters used around "Stint Time". I notice that that its different than than the quotes around "min". Might just be a posting anomaly, but I suspect your first quote character is not correct.


_________________
John
Schumacher Taxi #189
View user's profile Send private message
Reply with quote
Post  
Bravo sir! Thank you very much, somewhere along the way I assume copy/pasting back and forth from the Notes app the quotes got messed up. Now it's working perfectly. Thanks again!

View user's profile Send private message
Reply with quote
Post  
Tip, you could connect a GPIO to reset the stint timer. You could do it in such a way that a button press resets the count to 0.


_________________
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
True, but we power cycle the RCP at every pit stop, so that will serve us.

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