Last Updated: 31 May 2014
Other Articles to Check Out:
- The Power of Arduino <-- be sure to check out the various really useful Arduino-related links at the bottom of this post! They have helped me a ton.
- The Goal of a Lifetime
- Arduino micros() function with 0.5us precision - using my Timer2_Counter "Library"
- Arduino Power, Current, and Voltage Limitations
- Quick Tip: 4 Ways to Power an Arduino
- Parallel Charging Your LiPo Batteries
- Beginner RC Airplane Setup
- Thunder AC680/AC6 Charger & Computer Data-Logging Software
- All articles on my blog with the label "Arduino" - http://electricrcaircraftguy.blogspot.com/search/label/Arduino
I just released this library to GitHub!
I wanted a simple and universal, yet very powerful & reliable library to read a button or switch in such a way that I can easily implement toggled actions and momentary actions, know the true, debounced state of a button or switch at any given time, and specify whether I want an action to take place when the button is *pressed* or *released.* This library makes implementing all of these things easy for me, and I now use it on all of my projects that require reading a button or switch, so I wanted to share it with others. Hopefully you find it useful too. Check out the included examples.
This code is an elaboration of, and library form of, the main Arduino-sponsored "Debounce" example found here. Thanks to David A. Mellis, Limor Fried (LadyAda), and Mike Walters for writing that excellent and well-thought-out example code.
Download the eRCaGuy_ButtonReader Library here --> then go to "Download ZIP" at the bottom of the right-hand pane. See the Readme file right here too if you need help installing Arduino libraries.