Skip to main content

SCAN_I2C

Syntax​

SCAN_I2C

Description​

Scans the device's I2C bus and lists the 7-bit addresses of the components that answer.

I2C transactions can add noise to the data of a running acquisition; scan while acquisition is stopped.

Response​

If components answer:

I2C 0x48 0x50 ...

If none answers:

I2C (none)

Example​

scan_i2c.py
from hmcls_udp import Board

board = Board("192.168.1.11")
line = board.query("SCAN_I2C")[0]
addresses = [] if "(none)" in line else line.split()[1:]
print("found:", addresses)