Motor schield probelem

hello everyone,

Recently i bought an Arduino MEGA to control an rc car, i have already tested to control it with an Arduino Uno using an adafruit motor schield v1, and it worked very well

But my problem is that the motor schield does not work with the MEGA

Have you an idea why ? or any solutions ?

thank you dor the help

Adafruit says it is compatible with the Mega. Perhaps there is something unusual in the code you didn't show us?

Can you post the shortest possible program which compiles and shows the fault? Read "how to use this forum" for instructions on posting code.

Here it is my code, it’s the same who works with the UNO, i don’t think that there is a problem with data reading because i tried to light a LED and it works

i forgot to mention that i’m using bluetooth for command

#include <SoftwareSerial.h>
#include <AFMotor.h>
SoftwareSerial BT(A8, A9); // RX | TX


AF_DCMotor motor(2, MOTOR12_64KHZ); 
AF_DCMotor servo(4, MOTOR12_1KHZ); 

int VitesseMax= 250;
int VitesseMin= 100;

int Data=0; 
//int led = 22;


void setup() {
    Serial.begin(9600);
    BT.begin(9600);
    Serial.println(" la voiture est prete pour rouler ");

    motor.setSpeed(VitesseMax);
    servo.setSpeed(VitesseMin);
    //pinMode(led, OUTPUT);

}

void loop() {

  if (BT.available()){
   Serial.println(" la connexion est reussie");
    Data=BT.read();
    Serial.println(Data);

    switch(Data)
    {
      case 1:
      {
        Serial.println("avancer");
        motor.run(FORWARD);
        //digitalWrite(led,1);
      }
      break;

      case 2:
      {
        Serial.println("reculer");
        motor.run(BACKWARD);
      }
      break;

      case 3:
      {
        Serial.println("tourner a gauche");
        servo.run(BACKWARD);
      
      }
      break;
      
      case 4:
      {
        Serial.println("tourner a droite");
        servo.run(FORWARD);
       
      }
      break;

      case 5:
      {
        Serial.println("avancer a droite");
        servo.run(FORWARD);
        motor.run(FORWARD);
       
      }
      break;

      case 6:
      {
        Serial.println("avancer a gauche");
        servo.run(BACKWARD);
        motor.run(FORWARD);
       
      }
      break;

      case 7:
      {
        Serial.println("reculer a droite");
        servo.run(FORWARD);
        motor.run(BACKWARD);
       
      }
      break;

      case 8:
      {
        Serial.println("reculer a droite");
        servo.run(BACKWARD);
        motor.run(BACKWARD);
       
      }
      break;


      case 0:
      {
        Serial.println("arreter");
        motor.run(RELEASE);
        servo.run(RELEASE);
        //digitalWrite(led,0);
      }
      break;
      
    }
    
  }
  if (Serial.available())
  BT.write(Serial.read());

}

An UNO doesn't have pins A8 and A9, so this won't compile for an UNO.

What else changed between the two attempts?