How to Assemble the DFRobot Pirate 4WD Mobile Platform
This video walks through assembling the popular DFRobot Pirate.
It focuses mostly on what the instruction manual leaves out, which I hope will save you some time!
You can get the instruction manual at the link here.
Here is the code that I used to get all motors moving in the same direction:
//Using the Adafruit library to move 4 DC motors
//in one direction on the DFRobot 4WD Mobile Platform
//We need the Adafruit Library.
//There are two versions, this was written for the first version of the library
#include
// Create Motor objects and assign them to the correct motor termnials
AF_DCMotor motor_Back_L(1);
AF_DCMotor motor_Back_R(2);
AF_DCMotor motor_Front_R(3);
AF_DCMotor motor_Front_L(4);
void setup() {
//We can asjust the speed for the motors here
//the range is 0 to 255
motor_Front_R.setSpeed(200);
motor_Front_L.setSpeed(200);
motor_Back_R.setSpeed(200);
motor_Back_L.setSpeed(200);
}//close setup
void loop() {
//run each motor in the forward direction
motor_Front_R.run(FORWARD);
motor_Front_L.run(FORWARD);
motor_Back_R.run(FORWARD);
motor_Back_L.run(FORWARD);
}//close loop

Good stuff. Thanks.
Thanks for watching.
Would you happen to have a c code for this? I’m using the same robot platform except with a TI microcontroller. Hence the need for a c code, not an arduino one. Thank you!
Hi Nshah, no I don’t have the C code for this – sorry I can’t be of more help.