I have 8 TTP223 touch sensors for 8 relays. I want my microcontroller to know when anyone of the switches is high or low. For that I can take inputs from the same pins that switch relays. However, how would the microcontroller know that the state of the switches is changed in real-time?
I know Arduino has interrupts and they work fine with rising or falling edge. I could add interrupt for switch on/off on pin 2 and 3 respectively. But how do I do this for 8 pins? Is there some component that I could attach all 8 switches as input and it would generate a momentary pulse for Arduino to detect when any one of the switches is turned high or low?
Could I add this for 8 inputs?