Lua script command to get battery voltage on RC Track?

Q&A for the RaceCapture Plug & Play - general hardware related usage and operation; for app related questions please post in the RaceCapture app section.

also see the <a href="https://wiki.autosportlabs.com/RaceCapture_Quickstart">RaceCapture quick start guide</a>
Post Reply
GTIspirit
Posts: 249
Joined: Wed Jan 09, 2013 11:20 am
Location: SE Michigan

Lua script command to get battery voltage on RC Track?

Post by GTIspirit »

What's the Lua script API command to get battery voltage on the RC Track? It's not mentioned here:
Analog Sensor Functions

Reason I'm asking is because it's off a bit compared to what my ECU and multimeter measure. So I want to output the battery voltage on CAN to measure and record together with my ECU internal variable for battery voltage. Then I can figure out the proper linearization for battery voltage in the RC Track.

P.S. no, it's not different because of different measurement points in the voltage bus. I've put the multimeter at exactly the point where the RC Track is connected, and the multimeter reads very close to what the ECU reads, and not same as what the RC Track measures.
Last edited by GTIspirit on Sat Apr 11, 2020 1:38 pm, edited 1 time in total.

GTIspirit
Posts: 249
Joined: Wed Jan 09, 2013 11:20 am
Location: SE Michigan

Post by GTIspirit »

Answered my own question by thinking, what channel might brentp use if the RC Track has no analog inputs. If the last analog is connected to battery, and the RC Track has no analog, maybe it's 0.

Confirmed with this Lua script code:

Code: Select all

println&#40;'Battery&#58; ' ..getAnalog&#40;0&#41;&#41;
Hint, maybe the Wiki page could be updated. :idea:

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Thanks, we updated the wiki!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply