Switch keeps shorting Arduino/USB?

However, even when not pressing the button, the light will flicker on/off.

Sometimes if I even tap the wire going to the input, or even hover my finger over it, the input will turn high. =/

No, that sounds like a classic case of a floating input that lacks a proper pull-up or pull-down. Floating inputs is part of the real world where a digital input may not be either a reliable high or low, but rather a undefined value that changes with the phase of the moon, noise, finger position, etc.

Lefty

That sounds like a floating input, what value resistor have you got in the switch circuit ?

Switch or contact bounce causes multiple high/low switchings for a single button press.

I'm using a 10K resistor. Should I use a lower value?

phase of the moon

Its not just me then......

10k is about right, can you check the resistor is actually connected at both ends ?

Yeah, I'll check that.

Also, does it matter which gnd i plug into?

I'm currently using the one right above pin 13. Should I use one of the other 2, below the 5V?

All the Gnds on the board are connected together, so it shouldn't matter which you use.

Sometimes, especially if its an old/cheap/worn breadboard, or the resistors have thin leads they don't make contact. Do you have a meter ?

I can get a meter in a few minutes, but the breadboard and the resistor are brand-new. Although the breadboard is a fairly cheap one from Sparkfun.

Fun fact- I've been able to consistently hold my hand ~5inches above the wire, and get the light to turn on....

Theremin, anyone? ;D

EDIT: Okay, so what should I do with the meter?

Set it to volts (20v is common) and measure the voltage between Gnd and the digital pin with the button in both positions for starters, it should give a reading of very close to 5V when high and 0V when low, if either is a good way from 0 or 5, you've got a problem.

You might need 3 hands.......

I'm off to bed, I'll leave you in the capable hands of the Americans......

I tested the voltage from the end of the wire that will go into the digital pin, to the wire leading out from the GND. (Left wire to the digital pin in the breadboard, took GND wire out of breadboard)

When the switch is open, the voltage is 0. When it is closed it is around 4.7/4.8

As far as I know, all the components are working. The only thing that might not be working would be the resistor.

If I take the resistor out, and do a continuity check on both ends, the meter still reads "1". (When both leads of the meter are touched they read 0).

However, I am still able to measure voltage when the resistor is in the circuit.

Ignore my statement on the continuity check- wrong setting.

I took the resistor completely out, so it is all by itself, and set the meter on the "20K" setting, under the Ohms area. The resistor reads 9.94 from tip to tip.

I still wish to know why, when placing my hand 5 inches away from the circuit, it causes the value of the pin to go to HIGH.

If it didn't do that, it would be working perfectly. =/

I took the resistor completely out, so it is all by itself, and set the meter on the "20K" setting, under the Ohms area. The resistor reads 9.94 from tip to tip.

That boils it down to either a wiring mistake/misunderstanding, or not making a good connection. Be sure the ends of the resistor are clean metal as some can have clear glue like substance from how they are packaged. As stated, a schematic drawing (no matter how crude) is the universal language to use when discussing proper component wiring.

Lefty

I didn't see/feel any material on the end of the resistor. I have ensured a good connection into the breadboard (took it out, cleaned it off a bit, shoved it back in very firmly) and that has had no effect.

I'll try and get a schematic drawn, (although I'll probably mess it up) and post it.

The proximity thing is really making me frustrated though.

I used Fritzing to make a layout...

The layout-

The schematic-

I hope those are correct. =/

I hope those are correct. =/

Sorry they are not correct.

Try this drawing and instead of going to pin one of the invertor chip in the drawing it would go to your pin 2 on your arduino connector shield. Do you see the difference in wiring hook-up?

http://www.google.com/imgres?imgurl=http://www.seattlerobotics.org/encoder/mar97/basics4.gif&imgrefurl=http://www.seattlerobotics.org/encoder/mar97/basics.html&h=325&w=232&sz=3&tbnid=cKW9t1Mv2fZGyM:&tbnh=118&tbnw=84&prev=/images%3Fq%3Dpull-down%2Bresistor&zoom=1&q=pull-down+resistor&usg=__CmMsaatZVAp-QYJS_tlMoyXxqMU=&sa=X&ei=yGciTb7qDZG4sAPWud3NAg&ved=0CCMQ9QEwAQ

Lefty

I think so....

Is this correct then?

http://img814.imageshack.us/i/switchmoddedschem.jpg/

Edit: Disregard that, I know it will be wrong....

Wow, I got it working!

I was looking through Fritzing, and they have this exact tutorial. Even though the tutorial arduino has (http://arduino.cc/en/Tutorial/DigitalReadSerial), Fritzing's seemed to make more sense, and it worked the first time for me... :stuck_out_tongue:

Yeah, I'm probably just stupid with this, but hey, it works now...

Once again lefty, thanks for putting up with me. :-/