Created
April 26, 2020 09:15
-
-
Save ukaszjankowski/6ffca0fd179bcb6cafe5cc48cfa4a010 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HAL_StatusTypeDef result; | |
uint8_t i; | |
for (i=1; i<128; i++) | |
{ | |
result = HAL_I2C_IsDeviceReady(&hi2c1, (uint16_t)(i<<1), 2, 2); | |
if (result != HAL_OK) | |
{ | |
CDC_Transmit_FS(".", 1); | |
} | |
if (result == HAL_OK) | |
{ | |
uint8_t buf[10] = {0}; | |
sprintf(buf, "0x%X \r\n", i); | |
CDC_Transmit_FS(buf, sizeof(buf)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment