At the outset this eeems like a simple thing to do, but take care. Changes in approach often may mean rewriting your driver from scratch. After working with a customer who chagend their mind frequently I created an approach to allow a systematic method to create hierarchical menus and how to display dynamic data within that.
I wrote it up in a Circuit Cellar article "hierarchical menus in embedded systems" published in issue #160, November 2003. Circuit Cellar's business model requires you to pay a small amount, and for articles of that age you have to download the whole magazine. Let just say that the code was written for the Rabbit micro, but is all in C and should be easily portable.
Jack focuses on software, but there are other techniques. A pullup resistor with a capacitor works well (preferably followed by a schmitt trigger) for slow responses although you should be aware that when you close the switch a short spike of high current will flow through the switch. You can limit that with a small series resistor. A cross coupled NAND or NOR gate combination will work if you have a changeover switch. Also if you use a non-inverting buffer (like 2 x 74HC04 in series or a MC14050) and connect the output to the input by a 10K resistor and also use a changeover switch you will have a debounced output.
Other manufacturers also make debounce chips. Maxom does the MAX812 and several others. See this app note.
Hi Steve -- this looks like an amazing project -- I hope one day to see it with my own eyes -- with regard to the links to interesting sites and videos, I have to say that I love the christmas tree one -- wow!
What are the engineering and design challenges in creating successful IoT devices? These devices are usually small, resource-constrained electronics designed to sense, collect, send, and/or interpret data. Some of the devices need to be smart enough to act upon data in real time, 24/7. Are the design challenges the same as with embedded systems, but with a little developer- and IT-skills added in? What do engineers need to know? Rick Merritt talks with two experts about the tools and best options for designing IoT devices in 2016. Specifically the guests will discuss sensors, security, and lessons from IoT deployments.