Dashboard: how to calculate battery voltages?

Hello,

I have been hacking on a small VB app to connect to the dashboard port during matches to record every packet into a CSV file for analysis in Excel. It’s a handy little tool, but I’m looking to extend its functionality.

For now, I can’t figure out how to calculate, given the 1 byte battery voltage, the actual number of volts. Is there some magic formula I must run the byte through to get the proper voltage? :confused:

Thanks.

BTW, I may release this app once it’s a bit better. Right now it’s just a mash of code I wrote last-minute…I really needed it to figure out why our auto-correction in auton wasn’t working.

JBot

I have no way to test if this helps you, but I found this in ifi_aliases.h It leads me to believe that you should scale the readings you get back by the same amount as IFI does in this code.

/*
 *-----------------------------------------------------------------------------------------------------
 *---------- Aliases for Battery Voltage bytes --------------------------------------------------------
 *-----------------------------------------------------------------------------------------------------
 * Formula to calculate voltage in volts: 
 *     current_voltage = battery_voltage * 0.038 + 0.05; 
 */

#define battery_voltage     rxdata.rc_main_batt*15.64/256
#define backup_voltage      rxdata.rc_backup_batt*15.64/256