Russell McMahon wrote: >> Could be made into a page on PIClist, then it'll be available >> until the Internet breaks >> > > It's broken. > It was broken years ago. > As soon as the first sites were opened to the public everything > started to go wrong. > Its obviously far too dangerous to go out in public, let alone fly. > I think we should just give them ... > Oh. > Wrong thread. > OK .. > > > R :-) M > > > PS: Reading multiple switches on one pin is not uncommon but is a very > useful idea. Having pre-rolled code for those who are unaccustomed to > this is a good idea. Even more than 7 switches should be possible > using the same general method, subject to the accuracy of the ADC and > the resistor tolerances. Too many and you start to get annoying > resistor values unless you start to get innovative in the way you use > them. I don't know how Bob's method works in detail but if you wanted, > say, 16 switches you could try say 4 divider chains with similar > valued resistors in the switched portions and a different value above > this combination to the pin plus another resistor from pin to supply. > That way you get a series parallel arrangement. ... > > Russell, if the switches are crosspoint type (0.0 on resistance) you could have 150 switches on a single pin, but most switches these days are carbon button, which vary from 1 to 200 ohms when closed. That amount of error makes those switches unreliable. Also, the normal resistor error also makes a difference. If all of your resistors are 1%, about 20 switches are possible with perfect reliability. --Bob -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist