miércoles, 3 de junio de 2015

Enviar sms a un mv

#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8);

void setup()
{
  mySerial.begin(19200);
  Serial.begin(19200);
  }

void sendSMS()
{
  mySerial.print("AT+CMGF=1\r");                                  // AT command to send SMS message
  delay(100);
  mySerial.println("AT + CMGS = \"60947xxxx\"");        // recipient's mobile number,
  delay(100);
  mySerial.println("Hello, world.");        // message to send
  delay(100);
  mySerial.println((char)26); // End AT command with a ^Z, ASCII code 26
  delay(100);
  mySerial.println();
  delay(5000);        // give module time to send SMS
}

void loop()
{
  sendSMS();
  do {} while (1);   //hacer nada
}

1 comentario:

  1. hola buenas tardes ,una consulta existe un codigo para recibir ?? un sms del telefono a la sim900

    ResponderEliminar