7 ulog_info(
"I2C communication example with esp32");
11 uint8_t
data[6] =
"hello";
12 ret = i2c_master_write_sync(0x20 << 1,
data, 5);
14 ulog_error(
"Error writing to esp32: %d", ret);
16 ulog_info(
"Successfully wrote to esp32");
19 libtocksync_alarm_delay_ms(10);
22 ret = i2c_master_read_sync(0x20 << 1,
buffer, 5);
24 ulog_error(
"Error reading from esp32: %d", ret);
26 ulog_info(
"Successfully read from esp32");