Im having another problem with my code the error is "redefinition of 'AF_DCMotor motor'?
Adafruit has a V1 and a V2 motor shield. They have different libraries too. AFMotor.h is for the V1 shield. From the error, I can tell you installed V2 lib. For that you need to include:

#include &lt;Adafruit_MotorShield.h&gt;