AntonSangho / DataPi_Beekeeping

0 stars 1 forks source link

i2c 에서 bh1750 조도센서를 잡지 못하는 문제 #6

Closed AntonSangho closed 1 month ago

AntonSangho commented 1 month ago
from machine import I2C

sdaPIN = Pin(4) 
sclPIN = Pin(5) 

i2c = I2C(0, sda=sdaPIN, scl=sclPIN) 
devices = i2c.scan() 

if len(devices) == 0:
    print("No I2C device")
else:
    print("I2C device found :", len(devices))

for device in devices:
    print(" Hexa address: ", hex(device))

결과

MPY: soft reboot
I2C device found : 1
 Hexa address:  0x68

정상적이라면 bh1750 은 0x23으로 잡혀야함

AntonSangho commented 1 month ago

오랜지 색상 보드에서 점퍼 날린 선이 GP12번에 연결되어야하는데 다른데 연결되어있을 경우 문제가 발생함. 해결방법은 멀티미터로 점퍼선 쇼트 체크하거나 제대로 연결되어있는지 확인