Need Help with AdaFruit V2 motor shield 4x DC motor code

I need a simple code to run 4 DC motors off of an adafruit V.2 Motor shield. I’ve tried everything I can think of and it won’t compile. it literally just needs to make the 4 motors all turn in the same direction continously. On a time crunch anything would be more than appreciated! Thanks in advance!

sketch_may06a.ino (653 Bytes)

Adafruit_MotorShield AFMS=Adafruit_MotorShield()

Statements usually end with a ;

void setup() {
  // put your setup code here, to run once:
 Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
 Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2);
 Adafruit_DCMotor *myLeftMotor = AFMS.getMotor(3);
 Adafruit_DCMotor *myRightMotor = AFMS.getMotor(4)
}

Local variables that almost immediately go out of scope are not all that useful.

void loop() {
  // put your main code here, to run repeatedly:
myMotor->setSpeed(100); 
myMotor->run(FORWARD);

myOtherMotor->setSpeed(100);
myOtherMotor->run(FORWARD);

myLeftMotor->setSpeed(100);
myLeftMotor->run(FORWARD);

myRightMotor->setSpeed(100);
myRightMotor->run(FORWARD);
}

These
variables
are
not
in
scope.

Tools + Auto Format was put on the menu bar for a reason. Learn what that reason is.

I do truly apologize. i'm still really new to this. How do I put them in scope?

How do I put them in scope?

Make them global. That is, move them before setup().