attachInterrupt photon panic and restart

Hi All,

I am working on a garage door opener with a sparkfun capacitive touchpad as a button. I am trying to use an interrupt to call the opendoor/closedoor function if the button was touched. Every time I touch the button the photon panics and restarts. The touchpad is connected to D2.

here’s the code
const int TOUCH_BUTTON_PIN = D2;
void setup()
attachInterrupt(TOUCH_BUTTON_PIN, doorButton, RISING);

What am I doing wrong panicking the photon?

Thank you,

You missed out the interesting bit - how does your ISR look?

I guess you’ve got a delay() in there and that will definetly kill your controller.

1 Like

yeah I do have a delay … i’ll try to remove it and check again.
Thanks :slight_smile: