
如果涉及代码,需要报错提示与全部代码文本,请注意不要贴代码图片



等了好几天了,有大佬知道的吗
都和你说"请注意不要贴代码图片",别人无法复现错误,怎么帮你?
代码就是你们教程给的呀 没有任何改动,就是运行不了
from pyb import Pin, Timer
inverse_left=False #change it to True to inverse left wheel
inverse_right=False #change it to True to inverse right wheel
ain1 = Pin('P0', Pin.OUT_PP)
ain2 = Pin('P1', Pin.OUT_PP)
bin1 = Pin('P2', Pin.OUT_PP)
bin2 = Pin('P3', Pin.OUT_PP)
ain1.low()
ain2.low()
bin1.low()
bin2.low()
pwma = Pin('P7')
pwmb = Pin('P8')
tim = Timer(4, freq=1000)
ch1 = tim.channel(1, Timer.PWM, pin=pwma)
ch2 = tim.channel(2, Timer.PWM, pin=pwmb)
ch1.pulse_width_percent(0)
ch2.pulse_width_percent(0)
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))第二个import car
while True:
car.run(100,100)求回复回复回复呀
我猜你的car.py没有正确下载到OpenMV里。

这算正确吗,,,,,,
不知道,你要打开这个文件看看里面的内容。
现在是没有上面的保存了 程序也没问题 但是就是轮子不转
没有上面的问题了
新的问题,单独发帖子。