There was an error while loading. Please reload this page.
I2Cバスをスキャンして、接続されているデバイスのアドレスを表示します。
RA4M1 Clickerの例: scl(P205), sda(P206), VCC, GND の4ピンを接続します。
import machine i2c = machine.I2C(scl=machine.Pin.cpu.P205, sda=machine.Pin.cpu.P206) print('Scan i2c bus...') devices = i2c.scan() if len(devices) == 0: print("No i2c device !") else: print('i2c devices found: ', len(devices)) for device in devices: print("Decimal address: ", device, " | Hexa address: ", hex(device))
import machine i2c = machine.I2C(scl=machine.Pin.cpu.P100, sda=machine.Pin.cpu.P206) print('Scan i2c bus...') devices = i2c.scan() if len(devices) == 0: print("No i2c device !") else: print('i2c devices found: ', len(devices)) for device in devices: print("Decimal address: ", device, " | Hexa address: ", hex(device))
Home