tomfclarke / adafruit-motor-hat-cpp-library

C++ Port of the Adafruit Motor HAT Python Library
MIT License
8 stars 3 forks source link

Issues with Jetbot #4

Open xpeedster opened 3 years ago

xpeedster commented 3 years ago

Hi, I am trying this library with the Waveshare Jetbot, and the thing is I am able to spin the motors, but not able to change de speed.

Thanks for the help.

tomfclarke commented 3 years ago

Thanks for reporting! I'll take a look as soon as I can.

xpeedster commented 3 years ago

I took a much deeper look at it, checking the Jetbot code Waveshare has (which is written in Python, and uses the original python library) and they make extra calls to setPWM command.

I made it work adding some extra lines to the "adafruitdcmotor.cpp" (and obviously changing the header too).

I will share as soon as I can if you want me to.

Thanks for the reply tho. ^^

tomfclarke commented 3 years ago

Great! Sure, any suggestions are welcome!

hagoston commented 3 years ago

Hi @xpeedster, could you please share the JetBot compatible code? Thanks /Ágoston

JacobAvila commented 2 years ago

@xpeedster Thank you very much, I would appreciate too much you could share the way you solved it

glaumarkus commented 1 year ago

little bit late here, but just change the path for i2c device to always return the correct path for the jetbot, e.g. std::string getFilenameForBus (int busNumber) { return "/dev/i2c-1";// + std::to_string (busNumber); } instead of the RPi bus. Works without any issue for me