Actuellement je suis sur un projet et je dois envoyer un message par sms.
J'ai fait un programme qui normalement doit mais il ne fonctionne pas.
Quelqu'un pourrait me dire quel sont les erreurs que j'ai faits ?
#include <SoftwareSerial.h>
#include <String.h>
SoftwareSerial sim800h(2,3); // RX,TX
boolean sms;
void setup(){
sim800h.begin(9600);
Serial.begin(9600);
sendsms();
updateSerial();
}
void loop(){
updateSerial();
}
void sendsms(){
Serial.println("Sending text message...");
sim800h.print("AT+CMGF=1\r");
delay(100);
sim800h.println("AT+CMGS=\"+33 6 51 04 14 75\"");
delay(100);
sim800h.print("nuguyfytdh");
sim800h.print(char(26));
delay(100);
sim800h.println();
Serial.println("Text send");
}
void updateSerial()
{
delay(400);
while (Serial.available())
{
sim800h.write(Serial.read());
}
while(sim800h.available())
{
Serial.write(sim800h.read());
}
}