Upcycling remote-control cars

Remote control cars typically use 2 motors. One to drive the rear wheels and one to turn the front wheels.

The below code illustrates how each motor can be controlled. The key thing to understand is the difference between the front motor and rear motor.

#include <AFMotor.h>

AF_DCMotor motor_back(1, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
AF_DCMotor motor_front(2, MOTOR12_8KHZ); // create motor #2, 64KHz pwm

void setup() {
 motor_back.setSpeed(255); // set the speed to 200/255
 motor_front.setSpeed(200);
}

void loop() { 

 //motor_front.run(BACKWARD); 
 motor_back.run(BACKWARD); // the other way
 delay(1000);
 
 //motor_front.run(FORWARD); 
 motor_back.run(FORWARD); // turn it on going forward
 delay(1000);

 //motor_front.run(RELEASE); 
 motor_back.run(RELEASE); // stopped
 delay(1000);
}

// MOTOR12_64KHZ , MOTOR12_8KHZ , MOTOR12_2KHZ , MOTOR12_1KHZ