issue with digital pins?

Hello all,

I'm new to Arduino and microcontrollers in general. I'm building a MIDI control board, and I need to implement a lot of switches. Before I start using multiplexers/shift registers, I wanted to try setting up a single switch with the Arduino.

I used a pull-up resistor and connected a switch to one of the digital pins, but the serial print showed that the first 5 were stuck in HIGH state. I reset the board, set them to Input, etc., but they still register HIGH regardless of what I do.

Does my board have a short in it?

Thanks, Drew

whats the other end of the switch connected to?

Does my board have a short in it?

Maybe. But not from anything you've described.

I used a pull-up resistor and connected a switch to one of the digital pins, but the serial print showed that the first 5 were stuck in HIGH state

That's what a pull-up resistor is supposed to do. When you want to switch the pin, you connect it to ground. The logic is reversed (HIGH = OPEN; LOW = CLOSED).

That's the schematic I used.

What's strange is that it works fine for pins 6-12. Pins 1-5 and 13 all read HIGH regardless if anything's hooked up or not. That's what leads me to believe something is wrong.

Ah! Now I get it. It does sound like something is wrong with your Arduino.

Try wiring the questionable pins with pull-down resistors (the switch and 10K resistor are swapped). The pin should read low.

Pins 1-5 and 13 all read HIGH regardless if anything's hooked up or not.

That sounds like you are not setting the pins to input correctly. Get rid of the 100R resistor you don't need it. Check the ground is actually making contact and don't use pins 0 & 1 these are used for serial communication and shouldn't be used unless you know exactly what you are doing.

Solved! I was getting some random values due to the way I had wired it. Also was using a bad switch.

Thanks!