logo

舵机打脚,一直跳转到pca9685如图,请问是哪里不对吗?

2021-03-07 17:13
S
_5qrg
b0e75682-376b-491a-9a89-0738ad8f8b9e.png

a = obj.output()

#print(max(a))

b=a.index(max(a))

print(b)

print(clock.fps(), "fps")

b=a.index(max(a))

i2c = I2C(sda=Pin('P5'), scl=Pin('P4'))

servo = Servos(i2c, address=0x40, freq=50, min_us=650, max_us=2800, degrees=180)

if b==1:

servo.position(0, 0)

time.sleep_ms(500)

servo.position(0, 180)

time.sleep_ms(500)

2021-03-08 18:00
I
网红小智智 星瞳科技

原因:硬件连接错误,没有找到i2c设备。

应该是扩展板没有连接好,或者焊接的有问题。