I know it's noobish but i want to make clear in my mind how exactly i should setup my VBAT defines.

1. According to PatrikE configurator http://panoramaic.se/configurator/dev_20120414/
in the section V BAT monitoring: if you mark the checkbox the V_BAT CALCULATOR Button highlighted.
When clicked ...
Enter the nuber of cells in your battery. appears
In my case is 3cells (3S battery) so i put 3 in the box and then OK
Next
Enter Meassured Battery power appears
In my case is 12.6Volt (it's my battery fully charged) so i put 12.6 in the box and click OK
Next
Please enter VoltDifference from the point between the resistors and Ground.appears
With my voltmeter i'm taking 3.85 Volts in B and C of the above pic. so i put 3.85 i the box and click OK.
Next
You selected a 3S battery with 12.6 Volt .
And a diff on the Divider on 3.85!
Is this correct?..
appears just to verify that all your inputs are correct.
and click OK
And at the end the result..
Your VbatValue is 100 will be used as VBATSCALE:
2.Now in config.h file i found this......
Code: Select all
/********************************************************************/
/**** battery voltage monitoring ****/
/********************************************************************/
/* for V BAT monitoring
after the resistor divisor we should get [0V;5V]->[0;1023] on analog V_BATPIN
with R1=33k and R2=51k
vbat = [0;1023]*16/VBATSCALE
must be associated with #define BUZZER ! */
//#define VBAT // uncomment this line to activate the vbat code
#define VBATSCALE 131 // change this value if readed Battery voltage is different than real voltage
#define VBATLEVEL1_3S 107 // 10,7V
#define VBATLEVEL2_3S 103 // 10,3V
#define VBATLEVEL3_3S 99 // 9.9V
#define NO_VBAT 16 // Avoid beeping without any battery
so i'm changing the values according the results displayed in PatrikE configurator
and of course uncomment #define VBAT
Did i make anything wrong ?