Incompréhension d'un programme

Fermé
WiildLife Messages postés 85 Date d'inscription mercredi 21 octobre 2015 Statut Membre Dernière intervention 19 novembre 2020 - Modifié le 1 avril 2018 à 17:42
Bonjour,
Voila mon problème , j'ai crée un petit robot mélangeant tout plein de programme différent , ultrasons , photorésistance , pont en H , etc ... Mon problème étant que jusque la avec tous ces programmes , il n'y avait aucun problème de compatibilité , tout rentrée dans l’ordre mais arrive le module Arduino GSM Shield 2 , donc comme les autres programmes , je l'implémente dans mon programme "principale" le probléme est cette partie du programme contenant un While , je comprend le fonctionnement du While mais pas la suite , voici le programme

#include <GSM.h>

#define PINNUMBER "1234"

// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;

// char array of the telephone number to send SMS
// change the number 1-212-555-1212 to a number
// you have access to
char remoteNumber[20]= "0603608440";  

// char array of the message
char txtMsg[200]="test";

void setup()
{
  // initialize serial communications
  Serial.begin(9600);

  Serial.println("SMS Messages Sender");

  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }
  Serial.println("GSM initialized");
  sendSMS();
}

void loop()
{
// nothing to see here
}

void sendSMS(){

  Serial.print("Message to mobile number: ");
  Serial.println(remoteNumber);

  // sms text
  Serial.println("SENDING");
  Serial.println();
  Serial.println("Message:");
  Serial.println(txtMsg);

  // send the message
  sms.beginSMS(remoteNumber);
  sms.print(txtMsg);
  sms.endSMS(); 
  Serial.println("\nCOMPLETE!\n");  
}


Merci d'avance.