Go Down

Topic: home project (Read 459 times) previous topic - next topic

terrance72sg

hi i am trying to build a 4wd rc toy car controlled by ps3. i am new to arduino and have no idea how to go about it. basically i have an uno and say, 2 dual motor controller and a usb shield.

dual motor controller: http://www.dfrobot.com/index.php?route=product/product&keyword=DRI0002&category_id=0&description=1&model=1&product_id=66#.VlfUY7-HjT9

usb shield: http://www.dx.com/p/funduino-usb-host-shield-module-supports-uno-mega-for-google-android-adk-blue-313482#.VlfUuL-HjT8

understand that with 2 dual motor controller, i would have used up all my pwm pins on the uno so i cannot add on a servo to it.

where can i get the extra pwm pin for the servo or is there another arduino with more than 6 pwm pins that is compatible to the motor controller and usb shield?


be80be

4 motors only take 4 pins for PWM and that leaves you 2 for servo which only takes one each.
There's 15 pwm on the board you should be using for your USB shield
Quote
Arduino Mega 2560 (recommended)

jrdoner

There are 15 PWM wins on the Arduino Mega.

DuaneDegn

I'm pretty sure servos can be controlled from any I/O pin. They don't need to be used on PWM pins.

The h-bridge requires one PWM pin per motor as well as one digital pin (per motor) to control direction. I think there are still plenty of I/O pins left.

terrance72sg

Hi all tks for the valuable advise. is there a difference between the above dual motor controller and this dual motor contorller?

http://tronixlabs.com/news/tutorial-l298n-dual-motor-controller-module-2a-and-arduino/

so far I have managed to source for the dfrobot code but not this tronixlab code. Are the codes the same?

Robin2

You don't need a PWM pin for a servo. Any I/O pin will work. Note that the servo library disables PWM on pin 9 on the Uno - see the documentation.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

terrance72sg

Appreciated your advice, but i wouldn't have any other pins left beside the analog pins after I add in the usb shield.

Groove

Some analogue pins can be used for digital I/O
Per Arduino ad Astra

septillion

#8
Nov 27, 2015, 11:29 am Last Edit: Nov 27, 2015, 11:30 am by septillion
Some All ;) analogue pins can be used for digital I/O
At least on an Uno
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

DuaneDegn

Hi all tks for the valuable advise. is there a difference between the above dual motor controller and this dual motor contorller?

http://tronixlabs.com/news/tutorial-l298n-dual-motor-controller-module-2a-and-arduino/

so far I have managed to source for the dfrobot code but not this tronixlab code. Are the codes the same?
Don't pay more than $4 for a L298N module. They're ubiquitous on ebay. The first one you linked to has the advantage of using an inverter on the direction pins is you can control direction with a single I/O pin. You can add your own inverter to the cheap L298N boards as save a lot of money.

Here's my L298N tutorial (I used a different microcontroller but the principles apply to the Arduino).

Robin2

If you are content with a motor voltage below 10volts then the Pololu DRV8833 is much more convenient than an L298N.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up