Many Pythonistas are familiar with using decorators, but far fewer understand what’s happening under the hood and can write their own. It takes a little effort to learn their subtleties but, once grasped, they’re a great tool for writing concise, elegant Python.
This post will briefly introduce the concept, start with a basic decorator implementation, then walk through a few more involved examples one by one.
Continue reading “Make Your Python Prettier With Decorators”
What do you do when you’re into trackball mice, but nothing out there is affordable or meets all your murine needs? You build one, of course. And if you’re like [Dangerously Explosive], who has a bunch of old optical mice squeaking around the shop, you can mix and match them to build the perfect one.
The mouse, which looks frozen mid-transformation into a rodential assassin, is a customized work of utilitarian art. Despite the excellent results, this project was not without its traps. [Dangerously] got really far into the build before discovering the USB interface chip was dead. Then he tried to sculpt a base out of Plasticine and discovered he’d bought the one kind of clay that can’t be baked. After trying his hand at making homemade salt dough, he painstakingly whittled a base from scrap pine using a drill and a hacksaw.
Every bit of this mouse is made from recycled bits, which, if you pair that with the paint job and the chosen shade of blinkenlights, makes this a green mouse on three levels. One of the two parts of this mouse that isn’t literally green, the cord, is still ecologically sound. [Dangerously] wanted a really long tail, so he scavenged a charger cable built for fruity hardware and threaded it through a hollowed-out piece of purple paracord.
We love the thumb-adjacent scroll wheel and the trackball itself, which is a ping pong ball painted black. The cool part is the guide it rolls around in. [Dangerously] spent a long time hand-whittling the perfect size hole in a particularly wide mouse palm rest. All that plastic shaving paid off, because the action is smooth as Velveeta.
[Dangerously] certainly designed this mouse to fit his preferences, and ergonomics seem a bit secondary. For a truly custom fit, try using whatever passes for Floam these days.
Many people got their start with 3D printing by downloading designs from Thingiverse, and some of these designs could be modified in the browser using the Thingiverse Customizer. The mechanism behind this powerful feature is OpenSCAD’s parametric design capability, which offers great flexibility but is still limited by 3D printer size. In the interest of going bigger, a team at MIT built a system to adopt parametric design idea to woodworking.
The “AutoSaw” has software and hardware components. The software side is built on web-based CAD software Onshape. First the expert user builds a flexible design with parameters that could be customized, followed by one or more end users who specify their own custom configuration.
Once the configuration is approved, the robots go to work. AutoSaw has two robotic woodworking systems: The simpler one is a Roomba mounted jigsaw to cut patterns out of flat sheets. The more complex system involves two robot arms on wheels (Kuka youBot) working with a chop saw to cut wood beams to length. These wood pieces are then assembled by the end-user using dowel pegs.
AutoSaw is a fun proof of concept and a glimpse at a potential future: One where a robotic wood shop is part of your local home improvement store’s lumber department. Ready to cut/drill/route pieces for you to take home and assemble.
Continue reading “Robotic Wood Shop Has Ambitions To Challenge IKEA”
[Amen] obtained a microscope whose light source was an incandescent bulb, but the light from it seemed awfully dim even at its brightest setting. Rather than hunt down a replacement, he decided to replace the bulb with a 1W LED mounted on a metal cylinder. The retrofit was successful, but there were numerous constraints on his work that complicated things. The original bulb and the LED replacement differed not just in shape and size, but also in electrical requirements. The bulb was also part of an assembly that used a two-pronged plug off to the side for power. In the end, [Amen] used 3D printing, a bit of metal work, and a bridge rectifier on some stripboard to successfully replace his microscope’s incandescent bulb assembly with an LED. He even used a lathe to make connector pins that mated properly with the microscope’s proprietary power connector, so that the LED unit could be a drop-in module.
Working on existing equipment always puts constraints on one’s work, usually due to space limitations, but sometimes also proprietary signals. For example, a common issue when refitting a projector with an LED is to discover that the projector expects a stock bulb, and refuses to boot up without one. Happily, the microscope didn’t care much about the bulb itself, and with the LED positioned in roughly the same position as the original bulb’s filament [Amen] obtained smooth and even lighting across the field of view with no changes made to the microscope itself.
In 2011, [Fabio] had been working behind a keyboard for about a decade when he started noticing wrist pain. This is a common long-term injury for people at desk jobs, but rather than buy an ergonomic keyboard he decided that none of the commercial offerings had all of the features he needed. Instead, he set out on a five-year journey to build the perfect ergonomic keyboard.
Part of the problem with other solutions was that no keyboards could be left in Dvorak (a keyboard layout [Fabio] finds improves his typing speed) after rebooting the computer, and Arduino-based solutions would not make themselves available to the computer’s BIOS. Luckily he found the LUFA keyboard library, and then was able to salvage a PCB from another keyboard. From there, he programmed everything on a Teensy microcontroller, added an OLED screen, and soldered it all together (including a set of Cherry MX switches).
Of course, the build wasn’t truly complete until recently, when a custom two-part case was 3D printed. The build quality and attention to detail in this project is impressive, and if you want to roll out your own [Fabio] has made all of the CAD files and software available. Should you wish to incorporate some of his designs into other types of specialized keyboards, there are some ideas floating around that will surely improve your typing or workflow.
[MechEngineerMike] wrote in to share the enthusiasm over SimpleSumo, a series of open source, customizable robots he designed for mini-sumo battling and much more. For the unfamiliar, mini-sumo is a sport where two robots try to push each other out of a ring. [Mike]’s bots are simplified versions designed for education.
[Mike] was inspired by a video of some kids building mini-sumo bots who were doing anything and everything to personalize them. He vowed to make his own affordable, easy-to-build bots with education firmly in mind. His other major requirement? They had to be as easily customizable as that one potato-based toy that eventually came with a bucket of parts. As of this writing, there are 34 interchangeable accessories.
[Mike]’s first idea was to build the bots out of custom 3D-printed building blocks. He soon found it was too much work to print consistent blocks and switched to a modular cube-like design instead. SimpleSumo bots can do much more than just fight each other. [Mike] has written programs to make them flee from objects, follow lines, find objects and push them out of the ring, and beep with increasing frequency when an object is detected.
The bots are completely open source, but [Mike] sells kits for people who can’t print the parts themselves. He’s made a wealth of information available on his website including links to outside resources about mini-sumo, Arduino, programming, and 3D design. How about a complete series of assembly videos? First one is after the break. Don’t know how to build a battle ring? He’s got that covered, too.
For a sumo bot that’s more brains than brawn, check out Zumo Red, the smart sumo.
Continue reading “SimpleSumo Bots Teach More than Fighting”
How often after being exposed to Star Wars did you dream of having your own working lightsaber? These days — well, we don’t quite have the technology to build crystal-based weapons, but tailor-made lightsabers like redditor [interweber]’s are very much real.
Piggybacking off the Korbanth Graflex 2.0 kit — a sort of bare-bones lightsaber ready to personalize — [interweber] is using a Teensy 3.5 to handle things under the hilt. Instead of taking the easy route and cramming everything into said handle, a 3D printed a cradle for the electronics and speaker keep things secure. The blade is made up of two meters of APA102 LEDs.
As well as all the sound effects appropriate to ‘an elegant weapon for a more civilized age’, a cluster of buttons handle the various functions; , playing and cycling through music(more on that in a second), changing the color of the lightsaber — Jedi today, Sith tomorrow — enabling a flickering effect that mimics Kylo Ren’s lightsaber, color cycling, and a…. rave mode?
Continue reading “A Lightsaber, With Rave Mode”