Question
How to load 8-bit hex value in integer array.
Hello,
I am trying to communicate between stm32 and charger ic(bq25700a) and i am using I2C communication protocol.For that i have to transmit hex value in such a way that 8-bit LSB first and then 8-bit MSB.
I am transmitting hex value 0A00, so i am taking LSB in a array buf1[2]=00 and
MSB in buf1[3]=0A, but when i run the code ,getting error like 'invalid suffix "A" on integer constant'.
Please give me any suggestion.
Thanks.
int Buf1[4];
while (1)
{
Buf1[0]=0x24; //slave address+write
Buf1[1]=0x12;
Buf1[2]=00; //LSB Data
Buf1[3]=0A; //MSB Data
HAL_I2C_Master_Transmit(&hi2c1,0x12,Buf1,4,100);
}