Ok, I could really use some help with this from someone more experienced than I. I am relatively new to this so bear with me...
I have a LIS302DL hooked up my Arduino Pro 328. I can talk to it using i2c, and using Serial I can read back the xyz values. No problems.
When I then attempt to add a simple button to one of the digital pins, the Arduino will sometimes crash when the button is pressed. Even weirder, if I start up with the button pressed, depressing sometimes causes the arduino to crash. Sometimes things will work for a while, though often just one press/depress is enough to cause the crash.
I should note that I am using a homemade button - just a simple pair of foil plates and a 10Ohm resistor. I am using the internal 20K pull up resistor which can apparently be enabled by digitalWrite(pin, HIGH). On its own pressing the button works fine, only when using both the accelerometer and the button do things break. Even if I don't use any Serial output, or even read the digital pin which the button is connected to, the problem remains. Debouncing the button doesn't make a difference. Mimicking the action of the button by touching a resistor between the digi pin and ground pin on the Arduino directly also causes the same effect.
The one thing I can think of is that the accelerometer is connected by 10-way ribbon cable to the arduino board (at the moment only by a length of a few inches, but in the future possibly several feet). Is this arrangement likely to cause problems - particularly the one I'm having? And if so, what is the best cable/connector to link up the arduino and LIS302?
Any help would be much appreciated, thanks =)