Arduino Car
Arduino Car
Arduino Car
Arduino Car
Arduino Car
Arduino Car

Arduino Car

Regular price
$90.00
Sale price
$90.00
Unit price
per 

This is the official MakerKids Arduino car.

This kit comes assembled or unassembled, and it includes the following:

  • Arduino
  • Robot
  • Breadboard
  • Jumper wires to connect everything
  • Includes either a long USB cable or battery pack.  With the long cable, you can drive the robot via the USB cable.  With the battery pack,  you can program the robot and let it run without being connected to a computer or wall socket.

 

Red Rover's motor driver board makes the wheel drive motors appear as two continuous rotation servos:

So you'll be able to use your micro-controller's standard servo library to drive Red Rover. Set the motor to 180° and it'll drive at 100% forward. Set it to 0°, and the motor will run backwards at full speed. Set it to 90° and it stops.

Example Code

 

 

/*
   Red Rover Trundle Plot - tape a marker to your Red Rover
       and it draws a flower-like figure

   Plot **should** stay within 450 × 600 mm (US Arch C) pad
   and likely will fit ISO A2 pads, but **test first**
   and don't blame us for any stainage …

   Rover motors appear on Arduino as two servos on pins 5 & 6

*/

#include <Servo.h>

Servo lefty, righty;

/*
   drive - helper function to map motor speed (-100…100%) to
       Servo.write() input range (0…180°)

   Input:
       < 0 : reverse
         0 : stop
       > 0 : forward

   Output:
         constrained to valid Servo.write() input range

   Red Rover controller has effective deadband/ stop band
       of 87…93°, but requesting very low speeds may not
       result in expected motion

   Uses integer maths, so expect rounding/truncation.
*/
int drive(int speed) {
  if (speed < 0) {
    // reverse: -100…0% → 0…87°
    // inputs *and* outputs need to be constrained to valid range
    //     as map() does no range checking
    return constrain(map(constrain(speed, -100, 0), -100, 0, 0, 87),
                     0, 87);
  }
  if (speed > 0) {
    // forward: 0…100% → 93…180°
    return constrain(map(constrain(speed, 0, 100), 0, 100, 93, 180),
                     93, 180);
  }
  // default: stop
  return 90;
}

void setboth(int left, int right) {
  // helper to set both left & right motors between -100…+100% speed
  lefty.write(drive(left));
  righty.write(drive(right));
}

void setup() {
  lefty.attach(5, 1000, 2000);  // left  servo: pin 5
  righty.attach(6, 1000, 2000); // right servo: pin 6
  setboth(0, 0);                // initial state is stopped
}

void loop() {
  // veer right forwards by setting left motor a bit faster (75%)
  //     than the right motor (60%)
  setboth(75, 60);
  delay(750);         // trundle merrily onwards for ¾s

  // now stop abruptly
  setboth(0, 0);
  delay(250);         // give it ¼s settling time

  // veer left backwards: right now faster than left
  setboth(-60, -75);
  delay(750);         // same backwards trundle time as forwards,
  //                     else Red Rover spirals off into shrubbery

  // stop abruptly again and settle
  setboth(0, 0);
  delay(250);
}

(code on github: redrover_trundleplot.ino)

Tape a pen to it, place it on a big pad of paper, and this is what you'll get!