I2C - Scan I2C devices

Preparation

Example

Introduction

The example will scan the I2C bus for devices that is connected to Ameba. When a device is found, it will be shown on the serial monitor with the address of the device.

Procedure

Connect the I2C device to I2C_SDA and I2C_SCL of the board.

Open the example in “File” -> “Examples” -> “AmebaWire” -> “I2C_Scanner”.

1

When the I2C bus detect any I2C device, the serial monitor will show the address of the I2C device as shown below:

2

When there is no I2C device connected to the board, the Arduino IDE serial monitor will show the message below.

2

Code Reference

You can find detailed information of this example in the documentation of Arduino:

https://playground.arduino.cc/Main/I2cScanner/

Please confirm that QQ communication software is installed