Closed PlastiBots closed 1 year ago
After some testing, I figured it out. It seems that the M5StickC Plus library is making use of Channel 0 and 1. Once the motor is set on Channel 2, it works fine.
Motor motor1 = Motor(AIN1, AIN2, PWMA, offsetA, STBY, 5000 , 8, 2);
I've been trying to get my M5StickC-Plus working with various motor controllers including TB6612FNG / MX1508 and have come across an issue. They work fine on the M5Stick-C Plus without the M5StickCPlus.h library (and related features) included, but it fails when enabling the M5 library. In both examples below, the code compiles/downloads fine, but the motor fails to drive in the latter example. I also did some testing using the MX1508 motor driver board and the same issue happened and can re-create this issue using other similar libraries. Also verified both motor controller boards are working. I suspect there is some conflict with setting up ledcwrite related features (e.g. channels? etc)? As there are no errors thrown during compile time, I can't debug the issue.
I've included 2 samples below using the TB6612FNG controller:
Sample 1 WORKS: No M5 library included and works fine and the motor drives per instruction:
Sample 2 DOES NOT WORK: M5 library and a few features enabled. It compiles and downloads fine, but the motor does not drive.