SPST switch not triggering interrupt intermittently

Hey guys I have a quick question,

I have SPST switch that I have wired with on pin 2 of the 'duino with a 10k pull down resistor. I then did

attachInterrupt(0,someFunction,CHANGE);

It works most of the time but occaisonally it wont trigger the interrupt. I assume this is because the pin is probably floating?

10kOhm
I have it wired as 5V ---- [ SPST ] ----///\ ------ GRND

____PIN 2

Any ideas?

edit: fixed typo 100kOhm -> 10kOhm

Is it 10k as in your text description or 100k as in your diagram.

10k should be OK, 100k perhaps a bit large and maybe too slow to reliably generate an interrupt.

Do you have the internal pullup resistor enabled by any chance? In your configuration it should be off.

--
The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

Hey thanks for the reply. I'm using 10k. I had forgotten to set pin 2 as an input (is that what you mean by internal pullup resistor?) I hooked up a multimeter and its going from 0V to 4.78 like expected on the pin, but still working intermittently.

No, by pullup resistor I meant you would have code like:

digitalWrite(2, HIGH);

When pin 2 is an input, writing a HIGH to it enables the internal pullup resistor. So don't do this in your application.

Perhaps you can attach your whole code. It might be possible that you're getting switch bounce which makes it look like intermittent operation while really you're just getting a whole bunch of interrupts all happening at once (depending on how your code is written).

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