Go Down

Topic: Using Digital 22 on Mega 2650 (Read 895 times) previous topic - next topic

bucpatr

I'm sure there is something stupid simple I'm missing but I can't seem to figure out how to use the higher numbered digital pins( 22-53) in my project. I have a simple sketch that turns on the LED when a button is pressed. If I use +5v and GND with the switch connected to pin 2 everything works great. If I change my sketch to use pin 22 and move my switch wire to that port, the board turns off and back on when I press the button, as if something shorted out.

Can anyone give me some advice on what could be wrong? Is there something special I need to do when using higher numbered digital pins?

johnwasser

Sounds like you are missing a resistor somewhere.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Grumpy_Mike

Quote
f I use +5v and GND with the switch

That sounds like you have missed wired it. The only problem is why did you get away with it with pin 2? Probably another mistake.

bucpatr

I do have a pull-up resistor but mabey it's wired into the circuit incorrectly. I seem to recall reading somewhere that the arduino has built in pull-up resistors but that they are disabled by default. What would I need to do to enable the resistor for that pin?

Grumpy_Mike

Quote
What would I need to do to enable the resistor for that pin?

Do a:-
digitalWrite(pin,HIGH);
to turn them on.
However, if you have messed up the wiring that is not going to stop you shorting out the supply.

Go Up