Community Question

Hello all
Can I properly hook up an Arduino Motor Sheild to EZ-B, to run 2 DC motors.
If so, can I get some sort of diagram/schematic? I need to be able to control the speed and direction if both motors individually. Sorry, noob question.
Doombot
Commented August 2013
Thanks PJ! Exactly what I needed...
However if I separated PWM 3 and 11 on respective digital pins I should be able to control the speed of the motors right? I see you tied them together...
Rich
Commented August 2013
I would say that you should separate the PWM anyway since this will make the motor move, the dir will determine the direction. So if you only wanted one motor to move you couldn't do that with combined PWM.

The brake may not be required too. It would stop the motor but just shutting off the PWM (setting to 0) would allow it to freewheel which in my opinion would be better if being used for movement.

P.S. It's still showing unresolved this end too, not that it's a problem :)
Doombot
Commented August 2013
Ok Ill try it again...Thanks Rich and PJ! :D
Rich
Commented August 2013
In EZ-Builder, to make the motor move;

PWM control for whichever digital port you connect to PWMa
PWM control for whichever digital port you connect to PWMb
Set Digital for whichever digital port you connect to DIRa
Set Digital for whichever digital port you connect to DIRb

So, if you chose D8 to D11

PWMA to D8
PWMB to D9
DIRA to D10
DIRB to D11

In your custom movement panel, to move both forwards use the code;

Code:


PWM(D8,100)
PWM(D9,100)
SET(D10, on)
SET(D11, on)



For reverse

Code:


PWM(D8,100)
PWM(D9,100)
SET(D10, off)
SET(D11, off)



For stop

Code:


PWM(D8,0)
PWM(D9,0)
SET(D10, off)
SET(D11, off)



For left

Code:


PWM(D8,100)
PWM(D9,100)
SET(D10, on)
SET(D11, off)



For right

Code:


PWM(D8,100)
PWM(D9,100)
SET(D10, off)
SET(D11, on)

PJ_Dtechy
Commented August 2013
Yes Separating them is more effective, kinda just threw a quick visual together for you.
Question
Avatarby Doombot
Published Monday, August 12, 2013