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
installing Arduino libraries

Installing Arduino Libraries | Beginners Guide

IoT sewage project

Pumping poo! An IoT sewage project

ESP32 webOTA updates

How to update ESP32 firmware using web OTA [Guide + Code]

error message Brackets Thumbnail V1

expected declaration before ‘}’ token [SOLVED]

Compilation SOLVED | 1

Compilation error: expected ‘;’ before [SOLVED]

Learn how to structure your code

4 Comments

  1. LongDong on August 4, 2015 at 3:01 pm

    Good stuff. Thanks.

  2. Nshah on September 20, 2015 at 3:01 pm

    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!

    • MICHAEL JAMES on September 21, 2015 at 2:26 pm

      Hi Nshah, no I don’t have the C code for this – sorry I can’t be of more help.

Leave a Comment