Eu tenho esse GRPS shield http://www.geeetech.com/wiki/index.php/Arduino_GPRS_Shield
fiz o jumper direto dos pinos do shield (TX RX) para o arduino mega 19, 18.
Funciona perfeitamente, envia e recebe SMS (que é o que eu preciso).
O problema é que eu não posso usar os pinos 19 e 18 para a comunicação, pois estou usando todos os pinos de interrupção do mega no meu projeto.
Eu vou no arquivo GSM.cpp e alterei os pinos usados de 19, 18 para qualquer outro e não envia mais SMS. A parece funcionar pelo que vejo no serial monitor, porém alguma parte não funciona e o shield fica em espera.
Resumindo, preciso fazer a comunicação do shield com o mega2560 sem usar os pinos de interrupção (attachinterrupt).
Eu procurei bastante sobre isso, todos os lugares falam para usar os 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69, mas não funcionaram.
As alterações na biblioteca estão sendo atualizadas (usei um serial.print para testar isso).
Parece que o shield só funciona corretamente nos pinos 19, 18. Acho muito estranho.
Se alguém passou por isso e conseguiu solucionar, por favor, me avise. ![]()
Esperto que o problema tenha ficado claro.
*postei os resultados no serial monitor de acordo com os testes
*o sketch que usei é esse (padrão de teste da biblioteca):
#include "SIM900.h"
#include <SoftwareSerial.h>
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"
//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;
//To change pins for Software Serial, use the two lines in GSM.cpp.
//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.
//Simple sketch to send and receive SMS.
int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];
void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(2400)) {
Serial.println("\nstatus=READY");
started=true;
} else Serial.println("\nstatus=IDLE");
if(started) {
//Enable this two lines if you want to send an SMS.
//if (sms.SendSMS("3471234567", "Arduino SMS"))
Serial.println("\nSMS sent OK");
}
};
void loop()
{
if(started) {
//Read if there are messages on SIM card and print them.
/** deprecated method
if(gsm.readSMS(smsbuffer, 160, n, 20)) {
Serial.println(n);
Serial.println(smsbuffer);
}
**/
//get 1st sms
sms.GetSMS(1,n,20,smsbuffer,160);
Serial.println(n);
Serial.println(smsbuffer);
delay(1000);
}
};

