If you’ve ever designed an embedded system with at least one button you’ve had to deal with button debouncing. This is also know as contact bounce, a phenomenon where a button press can be registered as multiple button presses if not handled correctly. One way to take care of this is with a hardware filter built from a resistor-capacitor setup, or by using a couple of NAND gates. We find that [Jack Ganssle] put together the most comprehensive and approachable look at contact bounce which you should read through if you want to learn more.
We’re interested in software solutions for debouncing buttons. This seems to be one of the most common forum questions but it can be hard to find answers in the form of reliable code examples. Do you have debounce code that you depend on in every application? Are you willing to share it with the world? We’d like to gather as many examples as possible and publish them in one-post-to-rule-them-all.
Here’s some guidelines to follow:
- Please only include debounce code. Get rid of other unrelated functions/etc.
- You should send C code. If you want to also send an assembly code version that’s fine, but it must be supplementary to the C code.
- Please comment your code. This will help others understand and use it. You may be tempted to explain the code in your email but this info is best placed in the code comments
- Cite your sources. If you adapted this code from someone else’s please include a note about that in the code comments.
As an example we’ve included one of our favorite sets of debounce code after the break. Please note how it follows the guidelines listed above.
Continue reading “Open Call: send us your Debounce code”
[AviatorBJP] is building some impressive automatic transmissions using LEGO parts. Your best bet is to check out his YouTube channel as he’s got a slew of videos related to topic. We’ve embedded test footage of first and second generation vehicles as well as the most recent flywheel design after the break. But we’re getting ahead of ourselves, let’s look at how the system works.
Each transmission centers on a mechanism that includes hinged arms attached to a central axle. The arms are held together with a rubber band but as the axle spins faster, they overcome the elastic force of the band and begin to pivot outward. This pulls the shaft in one direction, moving its gear up to the next position in the transmission box. To test the system [AviatorBJP] uses a treadmill. A string is attached to the front of the vehicle to keep it in place and the treadmill is switched on to simulate engine power.
This design is quite brilliant, and he’s not keeping it to himself. If you’ve grown tired of the manual LEGO transmission you built, you can follow his multi-video build process to make one of these for yourself.
Continue reading “LEGO automatic transmissions”
[Matt] brought together a TV remote and cordless phone to add a locator system to the remote control. One of the best features of a cordless phone is the pager button on the base. When you press it the handset beeps until found. Matt gutted one and got rid of the unnecessary parts. He then cracked open his TV remote housing and inserted the telephone handset’s circuit board, speaker, and battery. The base station is used just like normal to locate the phone/remote combo, and has been modified with a charging cable to top-off the telephone battery which powers everything in the newly hacked unit. [Matt's] demonstration video is embedded after the break.
It’s too bad that he got rid of the microphone. It would be interesting to take calls on this thing.
Continue reading “Paging system for your TV remote”
Inkjet printheads are a pretty rare thing to see done in home workshops. We would love to see more and got really excited when we saw this single nozzle, drop on demand, head being built. using a piezo disk intended to be a cheap buzzer and some reprap magic, [Johnrpm] got some results. [Madscifi] has been refining the design of the nozzle and the two have shared the process with us. Since it drops a single droplet of liquid, it can be used in a variety of manners, such as dropping plain old boring ink, or dropping a solvent into a powder for some 3d printing. You can see an example of the 3d printing in sugar above.
[Eric Gregory] has gone a bit mad scientist on the Chumby, turning it into a bipedal bot. We expected all kinds of cool chumby hacking, but we can’t say we saw this one coming. [Eric] points out that with a 454Mhz processor, 64MB of RAM, 2GB of expandable storage and a USB host port, the Chumby is more than capable as a robotics platform. With the addition of a mysterious and soon to be announced sensor board, he has made this chumby into a walking biped. While anyone who can write programs for linux, or even write flash applications can create software for the chumby, [Eric] chose to port the Robot Vision Toolkit over. This opens the doors to people who can write in Basic or who have written for the C64 or Apple][. You can see a video of this guy in action after the break.
Continue reading “Chumby takes its first steps”