On April 11, 2005 04:06 pm, Harold Hallikainen wrote: > > Yup, you can read multiple keys, but you can't quite do it in the > > manner Mike is suggesting. Mike is close, but has to change his > > resistor ladder to R, 2R, 4R.... to catch multiple keypresses and I > > wouldn't recommend going more than 5 buttons on a plain PIC pin > > (using the method kRC = T), or 7 buttons on an analog input since > > by the 7th button you're at 64R (getting close to 1% tolerance > > values) . > > How about just going R, 2R like an R-2R D/A? It's simplest if your > switches are SPDT and switching between +5 and ground. You could use > resistor networks where the matching between resistors is much better > than the absolute tolernance. The resistor network is a good idea, but you wouldn't want to use 8 buttons on an 8bit analog input. Step back to 7 or 6 buttons unless you use a higher res analog input. >From a manufacturing point of view, I don't like having both power lines on the same leg of a switch, but yes, the SPDT 0v/5v idea works if you can use SPDT. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist