#include // Create a motor object for motor port #2 (M3 and M4) on the Motor Driver Board AF_DCMotor motor(4); void setup() { Serial.begin(9600); // set up Serial library at 9600 bps Serial.println("Motor test!"); motor.setSpeed(255); // Set the speed (0 to 255) } void loop() { // Run the motor forward Serial.println("Forward"); motor.run(FORWARD); delay(2000); // Run for 2 seconds // Stop the motor Serial.println("Stop"); motor.run(RELEASE); delay(1000); // Stop for 1 second // Run the motor backward Serial.println("Backward"); motor.run(BACKWARD); delay(2000); // Run backward for 2 seconds // Stop the motor Serial.println("Stop"); motor.run(RELEASE); delay(1000); // Stop for 1 second }