Arduino with 400 button ??

So im working on this project and realizing im about to have about 400 on/off buttons wich need to be able to address each one and breaking my head how to do it. another thing, there might be one or more on at the same time.

Thanks.

If you have to ask it is probably beyond you but here is how to do it:- http://www.arduino.cc/en/Tutorial/ShiftIn#.UyiD616poXE You will need 400 / 8 = 50 shift registers.

Im learning as i go... I knew the Shift Register IC and guessed there most be something like it but couldn't find any reference.

Thanks, U helped a lot.

That tutorial is poor. I would pullup to 5V, and use switch to connect pin to Gnd.
Then no worries about the switches accidentally taking out the 5 V supply.

Use SPI.transfer to read in the daisy chained switches.

digitalWrite (latchPin, LOW):
digitalWrite (latchPin,  HIGH); // capture the state of the switches
for (x=0; x<50; x=x+1){
switchArray[x] = SPI.transfer(0); // read MISO while writing out 0 on MOSI
}
// now act on the 50 bytes, switchArray[0] to switchArray[49]

I’d also go with a more modern chip - also less expensive as you’re buying a boatload of them: 74HC165
http://www.digikey.com/product-detail/en/SN74HC165N/296-8251-5-ND/376966
Be sure to put a 0.1uF cap on each device from it’s Vcc pin to Gnd, place it right next to the chip.

Why do you need a 0.1uF cap on each device from it's Vcc pin to Gnd?

breaking my head how to do it.

Pressing 400 buttons will break your fingers, too 8)

This implementation using 3 digital control lines and a 4017 may be of interest: http://forum.arduino.cc/index.php?topic=235438

By adding in another 4017 you can get 1000 switches.

bobdev: Why do you need a 0.1uF cap on each device from it's Vcc pin to Gnd?

Decoupling, look it up.

So im working on this project

Which project?

vffgaston:

So im working on this project

Which project?

http://forum.arduino.cc/index.php?topic=244885.0

Gotta love it when newbies post on a topic that hasn't active for 5-6 months or more and starts up a flurry of discussion from the veteran posters!

http://forum.arduino.cc/index.php?topic=244885.0

I'm afraid I do not get the whole thing =(