can i use GSM shield to receive SMS as interrupt, because i am working on gsm linked home security project, i was able to disable system remotely by sending ams, but it could not enable it again , because the system is waiting for input from keypad, that is why i need to GSM receive ams as interrupt
Well if your program is "locked" while waiting for a keypad input, then you can probably write a much better program ![]()
Since keypad input relies on a person pressing a button, and people are slow (relative to the microcontroller of course... I wouldn't say someone such as Usain Bolt is slow haha) you can probably make do with polling (checking periodically) the keypad. You can check the keypad, and check the software serial over and over.
Better yet, since the GSM shield will communicate via the software serial, it might be wise to use an interrupt to detect a keypress instead of an sms ![]()
Besides (I may be mistaken on this though) from what I've seen in the datasheet, while the GSM module will notify you when you receive a call (by sending "RING") it doesn't seem that it does anything similar for SMS. This means that you have to manually check for new SMS messages yourself anyway, so an interrupt might not even be possible. Even if it were possible, you still wouldn't get an "SMS interrupt". All you could get is a serial interrupt for when data is received (which as far as I know, SoftwareSerial cannot do, only hardware serial can do that) and you'd have to receive the data and interpret the GSM module's messages yourself
All communications with modem works through interrupts. You can see the GSMSoftSerial library, and modify the ISRs to detect more directly if a SMS has been received.