Basic Stamp switch matrix scan code examples?
Vern Graner
Posts: 337
I recently encountered a situation where I need to be able to scan eight N.O. switches (one four-direction joystick and four "select" buttons) with a BSII. I originally built a circuit that had each switch on its own pin, which of course consumed eight pins, thinking I had pins to spare.. yeah, I know..
So, of course, I now have need for more pins and it was pointed out on another list that I could use a 2 row by four column matrix for the switches to free up two pins. I've found a good online tutorial on how this is accomplished electronically, but I would like to know if anyone has some basic stamp code examples on how to scan a matrix of this type so I don't have to "re-invent the wheel".
Vern
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
So, of course, I now have need for more pins and it was pointed out on another list that I could use a 2 row by four column matrix for the switches to free up two pins. I've found a good online tutorial on how this is accomplished electronically, but I would like to know if anyone has some basic stamp code examples on how to scan a matrix of this type so I don't have to "re-invent the wheel".
Vern
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Vern Graner CNE/CNA/SSE | "If the network is down, then you're Senior Systems Engineer | obviously incompetent so why are we Texas Information Services | paying you? Of course,if the network http://www.txis.com | is up, then we obviously don't need Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Perfect! I found the Parallax Stamp Works document as a PDF right here and the chip is available from Mouser right here for as low as $0.36! Nice cheap, easy solution. At that price, I can order 10 of them and if some get sacrificed to the smoke diety, I won't cry.
Thanks Jon!
Vern
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Vern) : 4/11/2006 8:30:28 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax