Trying to run 4 motors with an Adafruit Motorshield, but can't get to run

I have been trying to run four motors using a Parallax joystick, but I keep getting error messages that go like this.

final_draft:15: error: variable ‘Adafruit_Motorshield begin’ has initializer but incomplete type

Can someone please give me suggestions as to what is wrong?- I think it has to do with setting up a class, but since I am fairly new at this, I am not sure what to do.


-Code is attached

final_draft.ino (1.54 KB)

Adafruit usually provide good code examples with their libraries. Find such an example and study it carefully.

#include <Adafruit_MotorShield AFMS.h>

This looks very odd. I don’t believe that library file names can have spaces in them.

#define Adafruit_MotorShield AFMS Adafruit_MotorShield()

What is this define supposed to do ?

Thanks for the suggestions!

Unfortunately, however, when I tried to use Adafruit’s examples that came with the motorshield (they are for the version 2 motorshield), their code crashed.

Here is their code for one motor (doesn’t work for me).

So far I have been unable to figure out to fix it.

DCMotorTest.ino (1.69 KB)

I fixed the issue with the spaces in the library file name though. Thanks!

As for the define function- I stuck that in so as to set up the variables for controlling the motors…not sure if it is necessary though.