Servo Control With HC-05

Hello...

I want to link a phone and an arduino with an HC-05 ... so I created ( with app inventor) an app but when I Push the bouton to change the angle of the Servomotor , he didn't move

So my goal is to control a Servomotor with a phone passing by an HC-05

Thanks for you helps

/* Inclut la lib Servo pour manipuler le servomoteur */
#include <Servo.h>
#include <SoftwareSerial.h>
#define Bluetooth 12;
#define servopos OUTPUT

int BluetoothRx = 11; // Broche 11 en tant que RX, à raccorder sur RX du HC-05
int BluetoothTx = 10;// Broche 10 en tant que TX, à raccorder sur TX du HC-05
int pos = 0 ; // variable to store the servo position

SoftwareSerial mySerial(BluetoothTx, BluetoothRx);
/* Créer un objet Servo pour contrôler le servomoteur */
Servo monServomoteur;

void setup() {
Serial.begin(9600);
monServomoteur.attach(9);

Serial.begin(9600);

}

void loop()
{
// Attache le servomoteur à la broche D9 monServomoteur.attach(9);
if (Serial.available()>= 0 ) {
int servopos = Serial.read();
Serial.println(servopos);
monServomoteur.write(servopos);
delay(20);
}

}

// Fait bouger le bras de 0° à 90°
//for (int position = 0; position <= 180 ; position++) {
// monServomoteur.write(position);
// delay(10);

// Fait bouger le bras de 90° à 10°
// for (int position = 90; position >= 0; position--) {
// monServomoteur.write(position);
// delay(10);
// }

 int servopos = Serial.read();
  Serial.println(servopos);
  monServomoteur.write(servopos);

What is the character you are sending from the app?

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R