openmv/scripts/examples/50-Arduino-Boards/Giga-H7/50-Board-Control/i2c_scanner.py
iabdalkader 98a29e0870 scripts/examples: Update examples.
- Add examples index.
- Remove RP2040's Bluetooth examples.
- Resort examples.
2023-10-29 21:21:55 +01:00

12 lines
323 B
Python

# This work is licensed under the MIT license.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# I2C scanner examples
#
from machine import I2C
i2c = I2C(1, freq=400_000)
for addr in i2c.scan():
print("Found device at address %d:0x%x" % (bus, addr))