Guide by Brenton; Makerverse Motor Driver, 2 Channel - Application Guide

Hi John,

Perhaps it is best to start from scratch here so we can eliminate any possible errors. Let’s test only the motor driver code by itself to start. It could be that there are some conflicts with the ESP32.

Download the module again and see if you can follow the first example here.

from Makerverse_Motor_2ch import motor

m1 = motor(pwmPin = 0, dirPin = 1)
m1.go()

No problem with this code.

What else did you have connected to your ESP when you experienced the error?

Could you also try this at a lower frequency?

Very strange behaviour! Using Thonny whichever of programs I import first (your test code or my original code). I get the error. If I import the alternative code after it will run.
It appears that
m1 = motor(pwmPin = 0, dirPin = 1)

throws the error until it is run again in the new code.

Added

try:
m1 = motor(pwmPin = 0, dirPin = 1)
except:
m1 = motor(pwmPin = 0, dirPin = 1)
and it now works !

Thanks Jack. Nothing else connected and I did not set any frequency. See. posts below how I have resolved it. It would be better if this was not necessary.
Chhers

2 Likes

Hi @John122579,

Glad to hear you got it working.

Very weird bug indeed.