I am troubleshooting a big weird problem on my robot. I am eliminating variable after variable to try and narrow it down.
I have a very short script for the teensy that drives two motors via a polulu motor control board. It also checks and lists the i2c devices detected. The script is for a teensy and I am uploading it using Platformio.
There are two robots, an older one and one that I am building now. Call them OLD and NEW. Both OLD and NEW have identical teensy 4.0, motor controller and motors. Both OLD and NEW have identical Raspberry Pi 4’s.
Running the same script on OLD produces the expected result. The motors move fast or slow based on the pwm I ask for in the code. They print out the name of the i2c devices.
Running that same script on NEW is unexpected. The i2c code is not detecting the i2c devices. And the motors turn, in the correct direction, except at one fixed speed (seems around 75%) no matter what the PWM.
We have replaced teensy, motor controller, cables, raspberry pis, and the problem persists.
My platformio specific question: can anyone imagine something having to do with how the program is compiled and uploaded, or some subtle version skew, or anything else, that would have those symptoms: i2c access is throwing errors (not simply not detecting i2c devices, but errors.) And motor can’t be controlled?