MAKE subscriber Brian writes in to point out MemAxe, a Simon-like game made with an 8-pin PicAxe microcontroller. It’s pretty simple, but i like how all the buttons are connected up using only one input pin. So how is this possible? Well, instead of reading the input pins using the digital input, they are instead connected up similar to a voltage divider, with resistor on each switch being twice that of the switch before it. Then, by measuring the voltage of the input pin and figuring out which combination of resistors corresponds to the value read, you can figure out which switches were pressed. Here is what the schematic looks like:
These are cool tricks, but before you go crazy optimizing your project, keep in mind that it might be cheaper/easier to just buy a processor with enough inputs, since they usually aren’t much more expensive.
ADVERTISEMENT