Ciao a tutti,
stò tentando di far trasmettere tramite sms (utilizzando il modulo gprs/gsm della seeeduino) ogni tot minuti i dati relativi alla posizione ricavati dal modulo gps logger di ladyada.
Il gps utilizza la seriale softwre inpostata sui pin 2-3, mentre il gprs utilizza i pin 0-1 di Arduino.
Le due Shield separatamente funzionano egregiamente (utilizzando gli sketch di esempio), ma quando vado a cercare di modificare gli sketch per inviare i dati, non ottengo alcun risultato.
Qualcuno è in grado di spiegarmi in che modo posso inserire all'interno dello sketch del datalogger gps anche la parte relativa al gprs in modo che ogni tot minuti invii i dati?
Lo sketch di esempio del gprs è il seguente:
void setup()
{
Serial.begin(19200); //Default serial port setting for the GPRS modem is 19200bps 8-N-1
Serial.print("\r");
delay(1000); //Wait for a second while the modem sends an "OK"
Serial.print("AT+CMGF=1\r"); //Because we want to send the SMS in text mode
delay(1000);
//Serial.print("AT+CSCA=\"+919032055002\"\r"); //Setting for the SMS Message center number,
//delay(1000); //uncomment only if required and replace with
//the message center number obtained from
//your GSM service provider.
//Note that when specifying a tring of characters
// " is entered as \"
Serial.print("AT+CMGS=\"+918446043032\"\r"); //Start accepting the text for the message
//to be sent to the number specified.
//Replace this number with the target mobile number.
delay(1000);
Serial.print("SIM900 and Arduino say Hi!\r"); //The text for the message
delay(1000);
Serial.write(26); //Equivalent to sending Ctrl+Z
}
void loop()
{
//We just want to send the SMS only once, so there is nothing in this loop.
//If we put the code for SMS here, it will be sent again and again and cost us a lot.
}
ed io vorrei unirlo a quello relativo al gps logger.
Grazie