Hi
Question:
Average currentvalue ofBQ34z100fromI2C - 1 bytedatareads
Iteupnidaverywell.
CURRENT: 0x0018 ->olryeogotoreadthe current value
Returns the instantaneous current measured by the gauge
SourceprogramI2CCOMMAND ();PublicgetdownWhereHave
QuestionsOlympiquestuffyfeeling.
Toa communication controlmicrocomputerATMEGA 128readstheinstantaneousvalue of current
Control () Subcommand address 0018 Read ();value0xffffcomes.
Dream, pleaselet me knowhow togetfavor.
Thank you very much.
Example 1:
/ /-----------------------------------------------------
/ / Pack_Voltage Reading
//-----------------------------------------------------
I2C_start ();
I2C_write (0xaa);
I2C_write (0x08);
I2C_start ();
I2C_write (0xab);
vt_l = I2C_read (1);
I2C_stop ();
I2C_start ();
I2C_write (0xaa);
I2C_write (0x09);
I2C_start ();
I2C_write (0xab);
vt_h = I2C_read (1);
I2C_stop ();
Tx_Pack [0] = vt_h;
Tx_Pack [1] = vt_l;
/-----------------------------------------------------
/ / Pack_Current Reading
//-----------------------------------------------------
// Current 0x0018 Read 0X0000 ----- ?
I2C_start ();
I2C_write (0xaa);
I2C_write (0x00);
I2C_write (0x18); / / current
I2C_stop ();
I2C_start ();
I2C_write (0xaa);
I2C_write (0x01);
I2C_write (0x00);
I2C_stop ();
I2C_start ();
I2C_write (0xaa);
I2C_write (0x00);
I2C_write (0xab);
I2C_write (0x00);
ac_l = I2C_read (1); --> Not Read_Data ?
I2C_stop ();
I2C_start ();
I2C_write (0xaa);
I2C_write (0x01);
I2C_write (0xab);
I2C_write (0x18);
ac_h = I2C_read (1); --> Not Read_Data ?
I2C_stop ();