I2C example for nrf52 DK board

I have a nRF52 DK board and all is working fine. I can load the UART peripheral example and talk to my iPhone. I want to add I2C capability to connect to a temperature/Humidity sensor. I tried to run the i2c_api application and I get an error when it tries to build. It tells me to set the correct I2C device. How do I set the correct I2C device and how to I see the SCL and SDA I2C control pins on the external connector. Should they be on P0.26 and P0.27 pins. I was trying to get the i2c_api example working so I could understand how to use the I2c functions. I am very familiar with the I2C protocol. If you can tell me how to select the I2C device, initialize it, and do reads and writes so that SDA/SCL is active on the external connector pins I would be very appreciative. Thanks for you help. I am sure it is operator and error on my part. I am new to the nRF52 DK board.

#if DT_NODE_HAS_STATUS(DT_ALIAS(i2c_0), okay)
#define I2C_DEV_NODE    DT_ALIAS(i2c_0)
#elif DT_NODE_HAS_STATUS(DT_ALIAS(i2c_1), okay)
#define I2C_DEV_NODE    DT_ALIAS(i2c_1)
#elif DT_NODE_HAS_STATUS(DT_ALIAS(i2c_2), okay)
#define I2C_DEV_NODE    DT_ALIAS(i2c_2)
#else
#error "Please set the correct I2C device"
#endif
Parents Reply Children
No Data
Related