cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, i got question about saving multiplies values of reading in function I2C. I got sensors that needs 6 bytes to read before moving to next 6 bytes of data, so i need to save those 6 bytes in array. How to save those data in array? (in my case buffer)

KSlav
Associate
HAL_I2C_Mem_Read(&hi2c1, MAX_READ, FIFO_DATA_REGISTER , I2C_MEMADD_SIZE_8BIT, &buffer, 6 , HAL_MAX_DELAY);
while((HAL_I2C_IsDeviceReady(&hi2c1, MAX_READ, 1 , HAL_MAX_DELAY)) != HAL_OK);

1 REPLY 1
S.Ma
Principal

Maybe &buffer[0] or simply buffer maybe more appropriate if you want to pass the address of the buffer in memory to fill.