| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
TWI Scanner Example

The TWI Scanner Example allows to scan the TWI bus in order to look for connected TWI devices. You can use it to find the address of a single device or to count the devices connected to the nRF board.

The application read sample data on all of possible TWI addresses and waits for a response. Based on the response, the application decides if there is a TWI device connected to the nRF board with a given address.

You can find the source code and the project file of the example in the following folder: `<InstallFolder>\examples\peripheral\twi_scanner`

# Testing

Test the TWI Scanner Example application by performing the following steps:

1. Compile and program the application.
2. Start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
   - Baud rate: 115.200
   - 8 data bits
   - 1 stop bit
   - No parity
   - HW flow control: RTS/CTS
3. Observe the logs from the application.

It is recommended to set the flag clear_bus_init during initialization, to make sure that the device is not stuck due to a break during a previous transmission, and that it will send a response.