[INFO]Piloter la vitesse de moteur en bluetooth

Salut a tous,
Je reviens avec mes questions :smiley:

Je souhaite piloter la vitesse de 2 moteurs DC depuis un téléphone et cela en bluetooth.
La graduation sur l'application est de 0 a 255 il me semble donc pas utile de mapper.
J'ai controler les valeurs depuis le terminal et elle arrivent correctement.

Carte : Arduino Nano
Driver : L9110
Module Bluetooth : HC-06
Application android : Arduino Bluetooth controler ( Dimmer mode )

Le code :

#include <SoftwareSerial.h>

// wired connections
#define MOTOR_B_PWM 10  //B_IA Motor B Input A --> MOTOR B +
#define MOTOR_B_DIR 11  //B_IB Motor B Input B --> MOTOR B -
#define MOTOR_A_PWM 6   //A_1A Motor B Input A --> MOTOR A +
#define MOTOR_A_DIR 5   //A_IB Motor B Input B --> MOTOR A -

int Speed;
SoftwareSerial bluetooth (2, 3);

void setup()
{  
    Serial.begin(9600);
    bluetooth.begin(9600);
  pinMode( MOTOR_B_DIR, OUTPUT );
  pinMode( MOTOR_B_PWM, OUTPUT );
  digitalWrite( MOTOR_B_DIR, LOW );
  digitalWrite( MOTOR_B_PWM, LOW );
  pinMode( MOTOR_A_DIR, OUTPUT );
  pinMode( MOTOR_A_PWM, OUTPUT );
  digitalWrite( MOTOR_A_DIR, LOW );
  digitalWrite( MOTOR_A_PWM, LOW );
}
void loop()
{
    
    if (bluetooth.available()>0) 
    {
       Speed = bluetooth.read();
       Serial.write(Speed);
       Mouvement(Speed,LOW,Speed,LOW);
    }
    else
    {
      Mouvement(0,LOW,0,LOW);
    }
}

void Mouvement(int param1,char param2,int param3,char param4)
{

  digitalWrite( MOTOR_B_DIR, param2 );
  analogWrite( MOTOR_B_PWM, param1);
  digitalWrite( MOTOR_A_DIR, param4 ); 
  analogWrite( MOTOR_A_PWM, param3); 
}

Si je fait :

void Mouvement(int param1,char param2,int param3,char param4)
{

  digitalWrite( MOTOR_B_DIR, LOW);
  analogWrite( MOTOR_B_PWM, 255);
  digitalWrite( MOTOR_A_DIR, LOW); 
  analogWrite( MOTOR_A_PWM, 255); 
}

Les moteurs tournent plein pot.

Juste un detail, quand je bouge le curseur sur l'application, j'ai la LED TX de l'arduino qui clignotte, et la valeur correspondante dans le terminal, et un bruit de grattement au niveau de l'electronique, mais aucun mouvement de moteur ... :S

Need help please