from machine import SoftI2C, Pin
import time
# Use your specific connections
i2c = SoftI2C(sda=Pin(16), scl=Pin(17), freq=100000)
print("Scanning I2C Bus on GP16/17...")
devices = i2c.scan()
if len(devices) == 0:
print("No I2C devices found! Check your wiring and VCC/GND.")
else:
print(f"I2C devices found: {len(devices)}")
for device in devices:
print(f"Decimal address: {device} | Hex address: {hex(device)}")
if device == 0x1E:
print(">>> SUCCESS: HMC5883L Magnetometer found!")Loading
pi-pico-w
pi-pico-w
Loading
bmp180
bmp180