Please i need your help !!!
I want to make an external interrupt project that notifying me via my gsm m10 Quectel shield which is connected with my arduino uno. The problem is :
When i try this TEST code with serial print everything WORKS GREAT .
every time i change state to pin 3 i get the serial print
#include <GSM.h>
GSM gsmAccess;
GSM_SMS sms;
volatile int state = LOW;
void setup()
{
Serial.begin (9600);
pinMode (3,INPUT_PULLUP);
attachInterrupt(1, blink, CHANGE);
}
void loop()
{
}
void blink()
{
delay (2000);
if (digitalRead (3) == HIGH){
}
else {
Serial.println (" test2 ");
}
}
but when put in, the gsm parameters for sending me an sms like the code below NOTHING HAPPENS
#include <GSM.h>
GSM gsmAccess;
GSM_SMS sms;
volatile int state = LOW;
void setup()
{
Serial.begin (9600);
pinMode (3,INPUT_PULLUP);
attachInterrupt(1, blink, CHANGE);
}
void loop()
{
}
void blink()
{
delay (2000);
if (digitalRead (3) == HIGH){
gsmAccess.begin() ;
char remoteNum[20]="694......";
char txtMsg[200]="SOS 1 ";
sms.beginSMS(remoteNum);
sms.print(txtMsg);
sms.endSMS();
}
else {
Serial.println (" test2 ");
gsmAccess.begin() ;
char remoteNum[20]="694........";
char txtMsg[200]="SOS 2 ";
sms.beginSMS(remoteNum);
sms.print(txtMsg);
sms.endSMS();
}
}