robohead456 / TB9051FTG_MotorDriver

Class to control a TB9051FTG motor driver
0 stars 0 forks source link

Documentation? #1

Open LukePrior opened 4 years ago

LukePrior commented 4 years ago

Hi I'm looking to use two of these https://www.pololu.com/product/2997 with my Arduino, do you have any wiring diagrams or other useful documentation?

robohead456 commented 4 years ago

The .h file contains a list of the connections to the breakout.

The .cpp has documentation for all of the functions.

One note: this was designed for a 3.3V board with a 12-bit ADC resolution. If you're using an Uno or similar device that has a 5V analog reference and 10-bit ADC then you'll need to change a few lines in the cpp file.

LukePrior commented 4 years ago

What changes do I need to make for an Arduino Mega 2560?

robohead456 commented 4 years ago

In the cpp file "4096" which is the ADC resolution (2^12) would need to be changed to "1024" for the 10-bit ADC of the Mega.

Similarly, the "4095" used for the 12-bit PWM would need to be changed to "1023"

Also the "3300" in the current read function refers to the analog reference in mV. It would need to be changed to "5000" since the Mega is a 5V board

I will try to push an update soon that will read these values from the board, but for now you can use this as a workaround.

LukePrior commented 4 years ago

Thanks

LukePrior commented 4 years ago

Any progress with the update to automatically read values from board?