NUCLEO-L476RG - using I2C
Posted: Sun Oct 24, 2021 7:19 pm
from machine import Pin
led=pyb.LED(1)
i2c=pyb.I2C(1)
i2c=machine.SoftI2C(scl=pyb.Pin('PB8'),sda=pyb.Pin('PB9'),freq=100000)
print(i2c.scan())
while True:
led.on()
pyb.delay(100)
led.off()
pyb.delay(100)
I am trying to run the above program. I am not getting any error. But print (i2c.scan()) is printing
[] and not detecting any error
I have connected blue of OLE to SCL/D15, yellow to SDA/D14 and black and red to GND and 3.3V
Any suggestions on what may be wrong?
led=pyb.LED(1)
i2c=pyb.I2C(1)
i2c=machine.SoftI2C(scl=pyb.Pin('PB8'),sda=pyb.Pin('PB9'),freq=100000)
print(i2c.scan())
while True:
led.on()
pyb.delay(100)
led.off()
pyb.delay(100)
I am trying to run the above program. I am not getting any error. But print (i2c.scan()) is printing
[] and not detecting any error
I have connected blue of OLE to SCL/D15, yellow to SDA/D14 and black and red to GND and 3.3V
Any suggestions on what may be wrong?