This post refers to
Am a bit of a newbie at this stuff but I have the exact opposite problem. When I run the test code in the example above, it works as it is (ie I have only one channel set as an input.) If I enable more than one channel as an input then neither channels trigger the interrupt.
I am running a D21G top board and have the latest libraries installed.
Am I missing something?
Hi, can you use the example sketch as here https://github.com/Industruino/libraries/blob/master/README.md#interrupts
and then instead of just using CH1, also use CH2-3-4 by including these lines:
Indio.digitalMode(1, OUTPUT); // Clear CH1 to LOW
Indio.digitalWrite(1, LOW); // Clear CH1 to LOW
Indio.digitalMode(1, INPUT); // Set CH1 as an input with interrupt
Indio.digitalMode(2, OUTPUT); // Clear CH2 to LOW
Indio.digitalWrite(2, LOW); // Clear CH2 to LOW
Indio.digitalMode(2, INPUT_MASKED); // Set CH2 as an input without interrupt
Indio.digitalMode(3, OUTPUT); // Clear CH3 to LOW
Indio.digitalWrite(3, LOW); // Clear CH3 to LOW
Indio.digitalMode(3, INPUT); // Set CH3 as an input with interrupt
Indio.digitalMode(4, OUTPUT); // Clear CH4 to LOW
Indio.digitalWrite(4, LOW); // Clear CH4 to LOW
Indio.digitalMode(4, INPUT_MASKED); // Set CH4 as an input without interrupt
Leave the rest unchanged, then this should trigger the interrupt and counter on CH1 and Ch3, while CH2 and CH4 are inputs without interrupt.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!