Ask Your Question

Rover: raspberry pi3+L298 h-bridge and i2cpwm library

asked 2019-08-24 14:01:48 -0500

v.leto gravatar image

Hi! I've found a source code where the wheels of a rover are commanded with an Adafruit PCA9685 16-Channel Servo Driver. The library used is i2cpwm by Bradan Lane. Is it possible to use the same library connecting 2 DC motors to the L298 h-bridge? Or does anyone know to guide the rover with this hardware and ROS? Thanks a lot

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-28 15:58:50 -0500

duck-development gravatar image

updated 2019-08-29 13:05:25 -0500

You could use the pca9685 to Controller the enable Inputs and other io for select the a and b. Und Drive you Rover.

Or use one for MCP23017 for the io.

Other cheap solution is a something linke this

as you rover has only 2 motors you could connect the pins to both pwm pins you do not use andy audio

it ist the bmc 12 and bmc13

see the positon from here

edit flag offensive delete link more


Excuse me, but I haven't understood anything.... my hardware is composeded by a L298 h-bridge and 2 DC motors.

v.leto gravatar imagev.leto ( 2019-08-29 02:35:13 -0500 )edit

It is not possible to use this library because the PCA9685 is an i2c to pwm chip.

If you like to drive with the full speed then you can use gpios of the pi. If you like to control the speed then you need at least a two channel pwm source. Something like the adafruit you said in you post.

duck-development gravatar imageduck-development ( 2019-08-29 10:46:17 -0500 )edit

Ok thanks. I don'have the adafruit anyway, just the H-bridge. :(

v.leto gravatar imagev.leto ( 2019-08-29 14:13:34 -0500 )edit

Then you can use this library

And generate pwm with the pi gpios

duck-development gravatar imageduck-development ( 2019-08-30 01:33:20 -0500 )edit

yeah, but I have to use ROS too.

v.leto gravatar imagev.leto ( 2019-08-30 04:44:39 -0500 )edit

Yes. You can usually use ROS and other python libraries at the same time.

ahendrix gravatar imageahendrix ( 2019-08-30 16:38:50 -0500 )edit

I know, but I have to write the code to do this............the i2cpwm library is ready to be used with ROS but unfortunately I can't use it because of the different hardware...

v.leto gravatar imagev.leto ( 2019-08-31 04:22:13 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-08-24 14:01:48 -0500

Seen: 39 times

Last updated: Aug 29