例程讲解23-Motor-Shield->motor-shield-power-driver 直流电机驱动板
import pyb
pinA = pyb.Pin('P3', pyb.Pin.OUT_PP, pyb.Pin.PULL_NONE)
pinB = pyb.Pin('P2', pyb.Pin.OUT_PP, pyb.Pin.PULL_NONE)
pinC = pyb.Pin('P1', pyb.Pin.OUT_PP, pyb.Pin.PULL_NONE)
pinD = pyb.Pin('P0', pyb.Pin.OUT_PP, pyb.Pin.PULL_NONE)
tim = pyb.Timer(4, freq=1000)
pinABPower = tim.channel(1, pyb.Timer.PWM, pin=pyb.Pin("P7"), pulse_width_percent=100)
pinCDPower = tim.channel(2, pyb.Timer.PWM, pin=pyb.Pin("P8"), pulse_width_percent=100)
while (True):
pyb.delay(1000)
pinA.value(0)
pinB.value(1)
pinC.value(0)
pinD.value(1)
pyb.delay(1000)
pinA.value(1)
pinB.value(0)
pinC.value(1)
pinD.value(0)
星瞳科技OpenMV官方中文文档函数讲解:
星瞳科技OpenMV官方中文文档函数讲解:
星瞳科技OpenMV官方中文文档函数讲解:
星瞳科技OpenMV官方中文文档函数讲解: