I have an ic MCP3428, I'm trying to connect it by I2C. Now problem is that I'm writing a code to figure out what the exact I2C address is? but it doesn't work
for(uint8_t i=0;i<255;i++) { HAL_Delay(10); if(HAL_I2C_IsDeviceReady(&hi2c1,i,2,20)==HAL_OK) { uint8_t address=i; break; } }