I verified my code and uploaded it to the board and that was successful.
Info: - Using Mega 2560 Arduino Board with Adafruit V1 - 3 DC 12 volt motors - on HP computer
Here is my code:
#include <AFMotor.h>
AF_DCMotor motor(1, MOTOR12_8KHZ);
AF_DCMotor motor2(2, MOTOR12_8KHZ);
AF_DCMotor motor3(2, MOTOR12_1KHZ);
void setup() {
Serial.begin(9600);
Serial.println("Motor Test!");
motor.setSpeed(20); //set speed of motor
motor2.setSpeed(20); //set speed of motor
motor3.setSpeed(25); //set speed of motor
}
void loop() {
Serial.print("tick");
motor.run(FORWARD);
delay(2000);
Serial.print("tock");
motor.run(RELEASE);
delay(5000);
Serial.print("tack"); //first song starts
motor.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor.run(RELEASE);
delay(14000);
Serial.print("tack");
motor.run(BACKWARD);
delay(2000);
Serial.print("tock"); //first song ends
motor.run(RELEASE);
delay(13000);
Serial.print("tick");
motor.run(FORWARD);
delay(2000);
Serial.print("tock"); //second song starts
motor.run(RELEASE);
delay(24000);
Serial.print("tick");
motor.run(FORWARD);
delay(2000);
Serial.print("tock"); //second song ends
motor.run(RELEASE);
delay(17000);
Serial.print("tick");
motor.run(BACKWARD);
delay(2000);
Serial.print("tock"); //third song starts
motor.run(RELEASE);
delay(23000);
Serial.print("tick");
motor.run(BACKWARD);
delay(2000);
Serial.print("tock"); //third song ends
motor.run(RELEASE);
delay(21000);
Serial.print("tick");
motor.run(FORWARD);
delay(2000);
Serial.print("tock");
motor.run(RELEASE);
delay(5000);
Serial.print("tick");
motor.run(FORWARD);
delay(3000);
Serial.print("tack"); //fourth song starts
motor.run(RELEASE);
delay(5000);
Serial.print("tack");
motor.run(BACKWARD);
delay(2000);
Serial.print("tock"); //fourth song ends
motor.run(RELEASE);
delay(21000);
//waving motor
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(5000);
//Waving motor
Serial.print("tick"); //first song starts
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(FORWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(FORWARD);
delay(1000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock"); //first song ends
motor2.run(RELEASE);
delay(14000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(5000);
Serial.print("tack"); //SEcond song starts
motor2.run(BACKWARD);
delay(2000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(FORWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(FORWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock"); //second song ends
motor2.run(RELEASE);
delay(15000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(5000);
Serial.print("tack"); //Third song starts
motor2.run(BACKWARD);
delay(2000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(FORWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(FORWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tock"); //third song ends
motor2.run(RELEASE);
delay(14000);
Serial.print("tick"); //fourth song starts
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(FORWARD);
delay(2000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock");
motor2.run(FORWARD);
delay(1000);
Serial.print("tick");
motor2.run(RELEASE);
delay(1000);
Serial.print("tick");
motor2.run(FORWARD);
delay(2000);
Serial.print("tack");
motor2.run(BACKWARD);
delay(2000);
Serial.print("tock"); //fourth song ends
motor2.run(RELEASE);
delay(7000);
//dancing motor
Serial.print("tock"); //first song starts
motor3.run(RELEASE);
delay(11000);
Serial.print("tick");
motor3.run(FORWARD);
delay(22000);
Serial.print("tock"); //first song stops //second song starts
motor3.run(RELEASE);
delay(16000);
Serial.print("tick"); //Second song stops
motor3.run(FORWARD);
delay(28000);
Serial.print("tock"); //Third song starts
motor3.run(RELEASE);
delay(15000);
Serial.print("tick"); //Third song stops
motor3.run(FORWARD);
delay(33000);
Serial.print("tock"); //fourth song starts
motor3.run(RELEASE);
delay(16000);
Serial.print("tick");
motor3.run(FORWARD);
delay(5000);
Serial.print("tock");
motor3.run(RELEASE);
delay(1000);
Serial.print("tick"); //fourth song ends
motor3.run(FORWARD);
delay(16000);
Serial.print("tock");
motor3.run(RELEASE);
delay(5000);
}