I recently bought Hexiwear for personal use and I think it is such a great product.
The only thing I am not sure about is the voltage provided by the battery. It doesn't seem to be specified in the hardware documentation.
Looking at the original firmware on GitHub I saw that the voltage (mV) of the battery can be measured as specified below:
Code: Select all
// convert data to milivolts
bat_mvolts = ( uint16_t )
( ( ( float )input[idx] * ( 3.3 / 65535.0 ) ) * 1000 );
if( bat_mvolts > 2670 )
{
output[idx] = 100;
}
else if( bat_mvolts > 2500 )
{
output[idx] = ( mE_t )( 50 + 50.0 * ( ( bat_mvolts - 2500 ) / 170.0 ) );
}
else if ( bat_mvolts > 2430 )
{
output[idx] = ( mE_t )( 30 + 20.0 * ( ( bat_mvolts - 2430 ) / 70.0 ) );
}
else if ( bat_mvolts > 2370 )
{
output[idx] = ( mE_t )( 10 + 20.0 * ( ( bat_mvolts - 2370 ) / 60.0 ) );
}
else
{
output[idx] = 0;
}
So I guess the battery voltage it is 3.3V at max. Am I right? The code I posted allows to display the percentage of the remaining battery life, but I really don't understand how the value of output[idx] is calculated. Where do those formulas come from? Can anyone help me?
Thank you very much!