si readstring contient une sous chaine


bonjour, je voudrais demmander à mon arduino de un print si serial.readstring contient une sous chaine

code: [select]

void loop() {
  if (serial.available()>0) {
      string command = serial.readstring();
      if(command.indexof("atd") > 0) {
        string phonenumber = getvalue(command, ' ', 1);
        serial.println("call phone");
        serial.println(phonenumber);
      }
}


l'idée serait que j'envoie à mon arduino cette chaîne de caractère par exemple :
atd 0677889911;
et m'affiche mon prinln

mais ma ligne
 if(command.indexof("atd") > 0) {

ne semble pas marché pour une raison que j'ignore



Arduino Forum > International > Français > Le bar (Moderators: jfs, Snootlab) > si readstring contient une sous chaine


arduino

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???