Hi,
For my project I want to use the 3 top buttons and the 5 way switch at the same time. Therefor I am attaching interrupts to all possible inputs:
/***** top buttons *****/
pinMode(WIO_KEY_A, INPUT_PULLUP);
pinMode(WIO_KEY_B, INPUT_PULLUP);
pinMode(WIO_KEY_C, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(WIO_KEY_A), buttonA, FALLING);
attachInterrupt(digitalPinToInterrupt(WIO_KEY_B), buttonB, FALLING);
attachInterrupt(digitalPinToInterrupt(WIO_KEY_C), buttonC, FALLING);
/***** 5 way switch *****/
pinMode(WIO_5S_UP, INPUT_PULLUP);
pinMode(WIO_5S_DOWN, INPUT_PULLUP);
pinMode(WIO_5S_LEFT, INPUT_PULLUP);
pinMode(WIO_5S_RIGHT, INPUT_PULLUP);
pinMode(WIO_5S_PRESS, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(WIO_5S_UP), switchUP, FALLING);
attachInterrupt(digitalPinToInterrupt(WIO_5S_DOWN), switchDOWN, FALLING);
attachInterrupt(digitalPinToInterrupt(WIO_5S_LEFT), switchLEFT, FALLING);
attachInterrupt(digitalPinToInterrupt(WIO_5S_RIGHT), switchRIGHT, FALLING);
attachInterrupt(digitalPinToInterrupt(WIO_5S_PRESS), switchPRESS, FALLING);
If I only do the top buttons, all buttons work as expected,
if I only do the 5way switch, all actions work as expected,
but if I attach all 8 interrupts, the 5way switch UP button and KEY_C seem to conflict.
It looks like only the interrupt that I attach first works.
I tried a work around, where I detach the interrupts of the top buttons when the 5way button is pressed and only then attach the other interrupts of the 5way switch,
but even after detaching the interrupt of KEY_C, I can not get the 5S_UP to work.
Does somebody else has seen this issue before?
Am I doing something wrong? Or is what I am trying to do impossible?
Thanks for all the help,
Sander