I have the gsm shield v2 with an arduino uno, the program is basic (lighting LED ), I am letting the gsm shield to send an sms when the setup finish indicating that "system works". and this part is fine.
but I also want to use interrupt in pin 2 to always check for changes, and light another led.
I cannot do interrupt because pin 2 is taken for the gsm communication, can any one help me with that? the purpose of using interrupt is just as example to demonstrate the use of an interrupt in a project, so I have to use any interrupt.
You can use a pin change interrupt on any available pin. There is no need to limit yourself to the external interrupts available on pins 2 and 3 of the uno.
If you are allowed to use a library in your project, then using Nico Hood's pin change interrupt library will make things as simple as using the external interrupt.
that is a great solution, I am trying the library now but always show error compiling, exist 1 status.
I am using this as described: attachPCINT(8, pin_ISR, CHANGE);
pin_ISR is the function containing the blink LED, and 8 is PCINT correspond to A0 from the table given.
I am trying the library now but always show error compiling, exist 1 status.
You have obviously done something wrong, but without either your code or the error message, how do you expect anyone to be able to help you.
Have you run a simple library example before integration into your code?
yes I did run an example and it work.
it seems like there is conflict between gsm library and the other library.
Please modify your last post to place your code within the code tags found at the </> icon in the tool bar. Your code will appear in a box like this
place your code here
Why are you using an interrupt to read a button push? If you have to use an interrupt in a school project at least use it for something requiring an interrupt. I would suggest a read of Nick Gammons tutorial on interrupts
Why are you trying to put a 30 second delay in an interrupt service routine? It won't work and is wrong in so many ways. Interrupt service routines should be quick to execute.