ceady

I have connected a honeywell magnetic door contact to pin 10 on the arduino with a pull up resistor configuration. 1k Resistor from 5v through contact sensor to gnd, with pin 10 connected between the resistor and sensor. Using a multimeter, I can verify logic high and low when the magnet is pulled away and placed near the sensor. Pin 10 is setup as an INPUT. I have a simple if pin 10 is low then do this loop. The problem is anytime the sensor is activated via the magnet the arduino locks up and needs to be reset. If I move the same input to pin 5 there is no problem, everything works as it should.

From the Arduino SPI reference page... you get an explanation of the issue. It's due to the hardware SPI on the chip.

Quote:

Quote

On the Arduino Duemilanove and other ATmega168 / 328-based boards, the SPI bus uses pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK). On the Arduino Mega, this is 50 (MISO), 51 (MOSI), 52 (SCK), and 53 (SS). Note that even if you're not using the SS pin, it must remain set as an output;