Setup a pins component containing all of the buttons you want to use, set them to active-low, and then wire up a ISR component to the output interrupt of the pins component.
Under the pins component, Input tab, you can configure the device to trigger an interrupt on either or both edges, as well as a dedicated interrupt using the check-box.
1 of 1 people found this helpful
Close. You want the 4 pins on the same component however, like this:
(Obviously, the left-hand side is merely how you plan to wire it external for documentation/remembering)
(And the isr_1 on the right-hand side is actually connected to the irq terminal output at the bottom of the pins component)
The following images are pictures of how I configured the pins for my use, but you may be able to change the polarity and edge interrups to suit your own needs I think:
I solved it thanks to you.
Thank you for your help.
There is one question.
Do you have to use a continuous port when using 4 ports?
For example, should not P0 [0 ~ 3] be used as P0 , P0 , P0 , P0 ?
For getting all of the interrupts on the same ISR routine, you will need to use contiguous ports. You most likely can split them up to have each pin be handled by a separate isr, but for my application I didn't need that functionality. The continuity is only necessary for having all four pins generate the same interrupt iirc.