is there an IC that does...

Using an Arduino Uno Ethernet, I've made a board that allows me to open/close my garage doors via a webpage. I'm now looking to add one additional element of functionality to my project, but am limited by the 2 officially supported interrupts of the Uno.

Is there an IC (DIP package) that would enable me to connect 2 reed switches and have either one of them trigger a single digital pin acting as an interrupt? This is more than a basic OR chip, as I need to be able to detect either a rising or falling edge of either switch.

Hope this is somewhat clear?
cheers,
J>

Not very clear - switches don’t have edges, signals have edges. What input is the chip expected to take, why do you need relays at all?

And for things as "slow" as switches, why do you need interrupts? Just check for the state of your switches in the main loop.

Finally, don't feel limited by the 2 interrupts on the chip. Every pin has a "pin-change interrupt" functionality that can make it generate an interrupt when its value changes. Here is some information:

http://www.arduino.cc/playground/Main/PinChangeInt

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

Is there an IC (DIP package) that would enable me to connect 2 reed switches and have either one of them trigger a single digital pin acting as an interrupt? This is more than a basic OR chip, as I need to be able to detect either a rising or falling edge of either switch.

You don't need a IC to do that. Just two diodes wired as a 'OR' gate will accomplish the same thing. And it can work with just a standard input pin as well as a interrupt pin. Wire one side of each switch to arduino ground pin. The other side of each switch goes to a seperate diode, cathode end. Both diode anodes then are wired together and wire to a digital input pin. Enable the internal pull-up resistor (or use an external 10k ohm resistor wired from the input pin to +5vdc). Either (or both) switch activating will generate a low at the input pin. If you do use a user interrupt pin utilize the FALLING or CHANGE trigger option.

Lefty

I think he wants to be able to detect when switch #2 is closed while switch #1 is already closed.

I myself is trying to come up with a solution, I don’t think its easy, a similar problem is faced by this product
http://rockbandparts.com/twin_rocker.html
and it looks like the creator simply opted to use a small 8 pin microcontroller.

frank26080115:
I think he wants to be able to detect when switch #2 is closed while switch #1 is already closed.

I myself is trying to come up with a solution, I don’t think its easy, a similar problem is faced by this product
http://rockbandparts.com/twin_rocker.html
and it looks like the creator simply opted to use a small 8 pin microcontroller.

If that is the case then he should do as RuggedCircuits suggested and learn how to use pin change interrupts and just wire each switch to a seperate digital pin that shares a common port, then it’s just software to decode what and when to respond to the switch state changes.

Lefty

Many thanks for the quick replies! I hadn't thought about simply polling the switches; interrupts just seemed like such an elegant way to do things. I've already soldered my circuit with the switches on pins D2/D3, so will play with the PinChangeInt and PcInt libraries as suggested. Do you know if I can use these when I've already configured "standard" interrupt methods?

cheers,
J>

If you have them wired to D2 & D3 already, don't "attach" interruptst 0 & 1, just use digitalRead(0) digitalRead(1) to read their state.

CrossRoads:
If you have them wired to D2 & D3 already, don't "attach" interruptst 0 & 1, just use digitalRead(0) digitalRead(1) to read their state.

I think you mean use digitalRead(2) digitalRead(3)