Bonjour à tous

je souhaiterai commander une simple lampe LED via une application Android
qui comporte des "commandes"
la réponse à ces commandes est sous la forme <t> , <r> etc ....
malheureusement je n'arrive pas à exécuter ces commandes au travers du croquis test suivant
car je n'arrive pas traduire ces caractères émis

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <SoftwareSerial.h>
///////////////////////// Creates the bluetooth object:
#define RxD 5 //Pin 5 pour RX (pin0=serial) vert
#define TxD 6 //Pin 6 pour TX, on peut changer noir
SoftwareSerial HC06(RxD,TxD);
 
 
String c_bt; //commande bouton
String data_bt = ""; 
char cMaster; // retour
 
void setup() {
     Serial.begin(9600);
     HC06.begin(115200);
}
 
void loop() {
     if (HC06.available()) {
 
        cMaster = 'x';  // retour
        while (HC06.available()) {
           char char_bt = (HC06.read());
           c_bt += char_bt;
          if (cMaster == 'x') {
                cMaster = char_bt;
          }   
 
        }
 
        data_bt = c_bt.substring(1); 
        Serial.println("data_bt = "+data_bt); 
 
    }
 
    while (cMaster != 'x') 
    {
        if (cMaster == 'u') {
           Serial.println("Commande u active "); 
           cMaster = 'x';
           break;
        }
        if (cMaster == 'r') {
          Serial.println("Commande r active "); 
          cMaster = 'x';
          break;
        }
        if ( cMaster == 't') {
           Serial.println("Commande t active "); 
           cMaster = 'x';
           break;
        }
        if (cMaster == 'm') {
            Serial.println("Commande m active "); 
            cMaster = 'x';
            break;
        }
        if (cMaster == 'e') {
           Serial.println("Commande e active "); 
           cMaster = 'x';
           break;
        }    
        if (cMaster == 'k') {  
          Serial.println("Commande k active "); 
           cMaster = 'x';
           break;          
 
         }
        cMaster = 'x';
        delay(200);
   } 
}
pouvez-vous m'aider svp à trouver ce qui ne va pas
je précise aussi que HC06 est bien reconnu par l'arduino et le tout est correctement appairé


encore merci par avance
pascal