Question
How can we integrate continuous data(Real time data)
Hello.
I am estimating SOC using coulomb counting method.By coulomb counting method ,we have to do integration of discharge current.I got successfully discharge current in a variable but it shows one value at a time.I know,by using array we can store the data but don't know how to update it continuously.
The variable 'current0' contain data in my code as given below .Please give me any suggestion.
int main(void)
{
uint8_t TxData;
uint16_t Data;
uint16_t current0;
while (1)
{
HAL_I2C_Master_Transmit(&hi2c1,0x16, &TxData, 1, 100);
HAL_I2C_Master_Receive(&hi2c1, 0x17, &Data, 2, 100);
current0=65536-Data; /* variable 'current0' contain data.*/
}
}