哥们我用l298n怎么直接驱动不转呢car的程序不用改吧 78接en 0123接in1234对吧
1
15762699279
@15762699279
0
声望
5
楼层
596
资料浏览
0
粉丝
0
关注
15762699279 发布的帖子
-
历程中 云台后半部分和小车后半部分 代码 是什么意思啊能否详细解释一哈
if blobs: max_blob = find_max(blobs) pan_error = max_blob.cx()-img.width()/2 tilt_error = max_blob.cy()-img.height()/2 print("pan_error: ", pan_error) img.draw_rectangle(max_blob.rect()) # rect img.draw_cross(max_blob.cx(), max_blob.cy()) # cx, cy pan_output=pan_pid.get_pid(pan_error,1)/2 tilt_output=tilt_pid.get_pid(tilt_error,1) print("pan_output",pan_output) pan_servo.angle(pan_servo.angle()+pan_output) tilt_servo.angle(tilt_servo.angle()-tilt_output) 和和def run(left_speed, right_speed): if inverse_left==True: left_speed=(-left_speed) if inverse_right==True: right_speed=(-right_speed) if left_speed < 0: ain1.low() ain2.high() else: ain1.high() ain2.low() ch1.pulse_width_percent(abs(left_speed)) if right_speed < 0: bin1.low() bin2.high() else: bin1.high() bin2.low() ch2.pulse_width_percent(abs(right_speed)) `