RobotShop V2 Rover

Lucas (alright I as well) have had grand ideas of cool robots.  This one, is cool, so far, but in the end will be too small for what we’re going to do.  However, that hasn’t stopped this from becoming the beginning of a cool little rover.
If you go to the RobotShop and search for the V2 the chassis kit does not show up.  You need to search for chassis or just visit this link.
I had ordered the treads and gearbox then found the chassis and ordered it.  Once you have all of that you need the Arduino and a motorshield.  I have a mega laying around from a 3D printer I’m never going to build (I mean I have a Printrbot so why would I want to build one).  I also have two motorshields laying around, one was to build a 3D printer the other was for a robot…no really.
The first thing we did was go to a V2 page (  There is a nice video link on youtube that shows how to assemble the chassis and gearbox.  I swapped the motors out for two that already had the wires attached and ready to go.
I did download the sample code (also on the page) that has a simple WASDX control system (where X is stop).  I also have an Arduino Motor Shield so I went to ( to look up the pins…and I rewrote some of the code (what? I couldn’t help myself).

The original code provided everything you need to move in all directions for the type of motor shield it was written for.  Below you’ll find my modified code for the Arduino Motor Shield.

The next steps are to add all of the awesome gadgets that we have in mind (including a bluetooth controlled from iOS device).

#define MOTOR_A 12
#define SPEED_A 3
#define BRAKE_A 9

#define MOTOR_B 13
#define SPEED_B 11
#define BRAKE_B 8

// from
//Function Channel A Channel B
//Direction Digital 12 Digital 13
//Speed (PWM) Digital 3 Digital 11
//Brake Digital 9 Digital 8
//Current Sensing Analog 0 Analog 1

void setup() {
//Setup Channel A
pinMode(12, OUTPUT); //Initiates Motor Channel A pin
pinMode(9, OUTPUT); //Initiates Brake Channel A pin
pinMode(3, OUTPUT); //Initiates Speed Channel A pin

//setup Channel B
pinMode(13, OUTPUT); //Initiates Motor Channel B pin
pinMode(8, OUTPUT); //Initiates Speed Channel B pin
pinMode(11, OUTPUT); //Initiates Brake Channel B pin


void loop() {
// Wait until a character is received
while (Serial.available() < 1) {}

char val =;

//255 is maximum speed
int leftspeed = 255;
int rightspeed = 255;

// Perform an action depending on the command
switch(val) {
case 'w'://Move Forward
case 'W':
forward (leftspeed,rightspeed);
case 's'://Move Backwards
case 'S':
reverse (leftspeed,rightspeed);
case 'a'://Turn Left
case 'A':
left (leftspeed,rightspeed);
case 'd'://Turn Right
case 'D':
right (leftspeed,rightspeed);

void stop(void) {
digitalWrite(MOTOR_A, LOW);
analogWrite(SPEED_A, 0);
digitalWrite(MOTOR_B, LOW);
analogWrite(SPEED_B, 0);

void forward(char a, char b) {
analogWrite (SPEED_A,a);
analogWrite (SPEED_B,b);

void reverse (char a, char b) {
analogWrite (SPEED_A,a);
analogWrite (SPEED_B,b);

void left (char a, char b) {
analogWrite (SPEED_A, a);
digitalWrite(MOTOR_A, LOW);
analogWrite (SPEED_B, b);
digitalWrite(MOTOR_B, HIGH);

void right (char a, char b) {
analogWrite (SPEED_A, a);
digitalWrite(MOTOR_A, HIGH);
analogWrite (SPEED_B, b);
digitalWrite(MOTOR_B, LOW);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.