user41031: I received the sainsmart motor controller a few days ago, and am now having trouble testing it. The Arduino I am using is an Arduino Mega 2560. I thought it was an I2C communication issue but that wasn't working. So here I am now asking for help. 
Here is my wiring.

Here is my code:
#include <AFMotor.h>

AF_DCMotor motor(2);

void setup() {
 Serial.begin(9600);           // set up Serial library at 9600 bps
 Serial.println("Motor test!");

 // turn on motor
 motor.setSpeed(200);

 motor.run(RELEASE);
}

void loop() {
 uint8_t i;

 Serial.print("tick");

 motor.run(FORWARD);
 for (i=0; i<255; i++) {
  motor.setSpeed(i);  
  delay(10);
 }

 for (i=255; i!=0; i--) {
  motor.setSpeed(i);  
  delay(10);
 }

Serial.print("tock");

motor.run(BACKWARD);

 for (i=0; i<255; i++) {
  motor.setSpeed(i);  
  delay(10);
 }

for (i=255; i!=0; i--) {
  motor.setSpeed(i);  
  delay(10);
 }


Serial.print("tech");
motor.run(RELEASE);
delay(1000);
 }

I also tried this one:
#include<AFMotor.h>
 AF_DCMotor motor2(2);
void setup() {
 // put your setup code here, to run once:
 motor2.setSpeed(255);
}

void loop() {
 // put your main code here, to run repeatedly:
 motor2.run(FORWARD);
  }

None of the two worked. If someone could help me that would be great. Thank You!!!

user41031: I figured out the problem. One of the terminals was damaged during transportation. Now it's all good. Thanks for the help.

41031: <p>I received the sainsmart motor controller a few days ago, and am now having trouble testing it. The Arduino I am using is an Arduino Mega 2560. I thought it was an I2C communication issue but that wasn't working. So here I am now asking for help. 
Here is my wiring.
<a href="https://i.stack.imgur.com/cPkKU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cPkKU.jpg" alt="enter image description here"></a></p>

<p>Here is my code:</p>

<pre><code>#include &lt;AFMotor.h&gt;

AF_DCMotor motor(2);

void setup() {
 Serial.begin(9600);           // set up Serial library at 9600 bps
 Serial.println("Motor test!");

 // turn on motor
 motor.setSpeed(200);

 motor.run(RELEASE);
}

void loop() {
 uint8_t i;

 Serial.print("tick");

 motor.run(FORWARD);
 for (i=0; i&lt;255; i++) {
  motor.setSpeed(i);  
  delay(10);
 }

 for (i=255; i!=0; i--) {
  motor.setSpeed(i);  
  delay(10);
 }

Serial.print("tock");

motor.run(BACKWARD);

 for (i=0; i&lt;255; i++) {
  motor.setSpeed(i);  
  delay(10);
 }

for (i=255; i!=0; i--) {
  motor.setSpeed(i);  
  delay(10);
 }


Serial.print("tech");
motor.run(RELEASE);
delay(1000);
 }
</code></pre>

<p><strong>I also tried this one:</strong></p>

<pre><code>#include&lt;AFMotor.h&gt;
 AF_DCMotor motor2(2);
void setup() {
 // put your setup code here, to run once:
 motor2.setSpeed(255);
}

void loop() {
 // put your main code here, to run repeatedly:
 motor2.run(FORWARD);
  }
</code></pre>

<p><strong>None of the two worked. If someone could help me that would be great. Thank You!!!</strong></p>
 41031: <p>I figured out the problem. One of the terminals was damaged during transportation. Now it's all good. Thanks for the help.</p>
