Stacking 2 Motor Driver

Autonomous Robot, Manual Robot, DC Motor Driver, Stepper Motor Driver, Servo, Multi PWM chip.....

Stacking 2 Motor Driver

Postby azahid2 » Tue Oct 18, 2016 2:48 pm


I'm currently working on a personal project, 3 wheel drive robot. Which require me to control each motor independently. Since Cytron 2A Motor Driver Shield is only capable of handling 2 motors, can I stack this 2 shields together to control 3 motors?
If yes, how would I implement it in arduino code?

Current setup:
1. Cytron ARM Cortex M0
2. Cytron 2A Motor Driver Shield (2 unit)
3. PS2 Shield

Can the code be like this?

Code: Select all
#include <Shield2AMotor.h>
#include <SoftwareSerial.h>
#include <Cytron_PS2Shield.h>

Cytron_PS2Shield ps2(2, 3); // SoftwareSerial: Rx and Tx pin
//Cytron_PS2Shield ps2; // HardwareSerial, note:
//Pin declaration

int mtr1 = 5; //PWM /////////FIRST MOTOR SHIELD/////
int mtr2 = 6; //PWM /////////FIRST MOTOR SHIELD/////
int mtr3 = 11; //PWM ////////SECOND MOTOR SHIELD///
int RightDir = 4;
int LeftDir = 7;

void setup()
  ps2.begin(9600); // This baudrate must same with the jumper setting at PS2 shield
  ps2.reset(1); //call to reset ps2 shield
  Serial.begin(9600); // Set monitor baudrate to 9600
Posts: 1
Joined: Tue Oct 18, 2016 2:41 pm

Re: Stacking 2 Motor Driver

Postby Idris » Wed Oct 19, 2016 10:25 am

Hi azahid2,

Before we verify your code, could you share a few clear photos of your hardware setup?

Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
User avatar
Posts: 380
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Return to Robot Controller

Who is online

Users browsing this forum: No registered users and 5 guests