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.
Lua script command to get battery voltage on RC Track?
Lua script command to get battery voltage on RC Track?
Last edited by GTIspirit on Sat Apr 11, 2020 1:38 pm, edited 1 time in total.
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:
Hint, maybe the Wiki page could be updated.
Confirmed with this Lua script code:
Code: Select all
println('Battery: ' ..getAnalog(0))