Bonjour, je suis actuellement en projet de terminal,et ma problématique c'est d'envoyer un SMS d'alerte a l'aide d'une carte Arduino Uno et un GSM (Shield GPRS V3.0 113030009), j'ai trouvé un code sur internet que j'ai un peu modifier mais je ne reçois toujours pas de message,mon programme est suivant:
#include <SoftwareSerial.h>
SoftwareSerial gprsSerial(7,8);
void setup()
{
gprsSerial.begin(19200); // GPRS shield baud rate
Serial.begin(19200);
delay(500);
}
void loop()
{
if (Serial.available()) // if there is incoming serial data
switch(Serial.read()) // read the character
{
case 't': // if the character is 't'
SendTextMessage(); // send the text message
break;
}
if (gprsSerial.available()){ // if the shield has something to say
Serial.write(gprsSerial.read()); // display the output of the shield
}
}
void SendTextMessage()
{
Serial.println("Sending Text...");
gprsSerial.print("AT+CMGF=1\r"); // Set the shield to SMS mode
delay(100);
// send sms message, the phone number needs to include the country code e.g. if a U.S. phone number such as (540) 898-5543 then the string must be:
// +15408985543
gprsSerial.println("AT+CMGS = \"+xxxxxxxxxx\"");
delay(100);
gprsSerial.println("TEST"); //the content of the message
delay(100);
gprsSerial.print((char)26);//the ASCII code of the ctrl+z is 26 (required according to the datasheet)
delay(100);
gprsSerial.println();
Serial.println("Text Sent.");
}
Quand je met le programme sur Arduino ça marque: Compilation terminée donc ça détecte pas d'erreur mais malgres ça, je reçois rien, aidez moi svp je passe ma derniere revue le 10 mai, Merci d'avance.