Need more Digital pins, Can I use 2 arduinos?

Hi,

In my device I need approximatly 20 digital pins, and the duemilanove only has 13. I have another duemilanove, and was wondering if I could connect the 2 arduinos so that I am able to use a total of 26 pins? If so how is it done?

Thanks :D

In my device I need approximatly 20 digital pins

That's handy, because that's exactly how many digital pins the Duemilanove has. Just use the analogue pins as digital ones.

I didn't know you could use the anolog pins as digital pins. Thanks! ;D

If that's not enough and you want outputs try an 74HC595 shift register. Each chip will give you 8 outputs with three pins and if you daisy chain them you add 8 outputs for every chip on the same three wires.