digital pins won't all respond...

hello all, first time posting but i've enjoyed the forums for a while.

I'm using a new arduino (usb version, atmega168) in Max/MSP using the arduino2max patch.

Most things are running quite well, with one exception. I'm using lots of different buttons and switches in my digital inputs...the switches all work fine on every pin, but the push buttons I have don't respond as well. They work fine in my digital6 pin, but not in any others.

All of the buttons work in pin 6, so i know they are not broken.

All of my pins work with normal switches, so i know the pins are not busted.

Oddly, the buttons work in my analog pins (sending 0-2 when not pressed and 100-1000 when pressed), but for my current project i need to use these buttons in my digital pins.

I hope I've explained myself well, any help would be greatly appreciated!


how do you have your switches/pushbuttons wired?

What value of pull-up or pull-down resistor did you use/


well, the buttons are quite simple, just ground/signal. they work fine without any resistors in pin 6.

the plot thickens, however, because the buttons appear to work perfectly fine in my friend's arduino. so i'm thinking i might have broken mine...i was experimenting a lot last week, which could explain a lot.

thanks for the reply...any other ideas are welcome, but i think i'm just going to use some different switches instead!


while they might work intermittently, you need either pull-up or pull-down resistors to sense a switch or button properly. Without this, the voltage on the input pin floats in one of the switch positions. When the pin "floats" you get all kinds of interesting and unpredictable results, as you have described.

Add a resistor as shown in this tutorial to each switch/button and I predict it will all work great!