That's correct. --Bob Lindy Mayfield wrote: > So basically you have an 8 bit buffer which shows the state of each key over a 10 ms/bit time frame. > > That's really cool! > > Is #3 below correct, though? The way I understand it, b'11110000' (given 0=pressed) would mean that at one point 80 ms ago the button was up (4 1's) and was then held down for 40 ms (4 0's). Or do I misunderstand how it works? > > I can see using this method it would be easy to implement repeating and speeding up, etc. > > > >>About 10 years ago I began using a bulletproof way to process >>keys: >> >>1. I read the keys- all of them- every 10ms or so. I can either >>read 'em >>all at one tome, or rotate so that I read each one on a rotating >>basis. >>Doesn't matter how its done, it works perfectly regardless. >> >>2. Every 10ms I read the key and shift its value into a register >>decicated just for that application. >> >>3. If the key is ZERO when it is pressed, I look for the pattern >>b'11110000' on that key's register. When that is seen, that key >>was >>PRESSED AND RELEASED, so set a flag. To prevent more action, jam >>the >>key's register with '11111111' so it can't be used again. >> >>This works great. If anyone is interested, I'll publish some >>code. >> > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004 > > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- Replier: Most attachments rejected -------------- Bob Axtell PIC Hardware & Firmware Dev http://beam.to/baxtell 1-520-219-2363 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body