Last time, I showed you how to throw together a few modules and make a working macropad that could act like a keyboard or a mouse. My prototype was very simple, so there wasn’t much to debug. But what happens if you want to do something more complex? In this installment, I’ll show you how to add the obligatory blinking LED and, just to make it interesting, a custom macro key.
There is a way to print data from the keyboard, through the USB port, and into a program that knows how to listen for it. There are a few choices, but the qmk software can do it if you run it with the console argument.
The Plan
In theory, it is fairly easy to just add the console feature to the keyboard.json file:
I recently picked up one of those cheap macropads (and wrote about it, of course). It is surprisingly handy and quite inexpensive. But I felt bad about buying it. Something like that should be easy to build yourself. People build keyboards all the time now, and with a small number of keys, you don’t even have to scan a matrix. Just use an I/O pin per switch.
The macropad had some wacky software on it that, luckily, people have replaced with open-source alternatives. But if I were going to roll my own, it would be smart to use something like QMK, just like a big keyboard. But that made me wonder, how much trouble it would be to set up QMK for a simple project. Spoiler: It was pretty easy.
The Hardware
Simple badge or prototype macropad? Why not both?
Since I just wanted to experiment, I was tempted to jam some switches in a breadboard along with a Raspberry Pi Pico. But then I remembered the “simple badge” project I had up on a nearby shelf. It is simplicity itself: an RP2040-Plus (you could just use a regular Pi Pico) and a small add-on board with a switch “joystick,” four buttons, and a small display. You don’t really need the Plus for this project since, unlike the badge, it doesn’t need a battery. The USB cable will power the device and carry keyboard (or even mouse) commands back to the computer.
Practical? No. But it would be easy enough to wire up any kind of switches you like. I didn’t use the display, so there would be no reason to wire one up if you were trying to make a useful copy of this project.
We’re all used to emulating older computers here, and we’ve seen plenty of projects that take a cheap microcontroller and use it to emulate a classic home computer or gaming platform. They’re fun, but serve mostly as a way to relive old toys.
As microcontrollers become faster though it’s inevitable that the machines they can emulate become more powerful too, so we’re moving into the realm of emulating productivity machines from years past. An example is [Ilya Maslennikov]’s pico-286, which as its name suggests, is a 286 PC emulator for the Raspberry Pi Pico.
It has an impressive set of sound and video card emulations, can drive either a VGA or an HDMI monitor, and uses a PS/2 keyboard and mouse. If DOS games are your thing it should provide what you want, but it’s caught our eye because there was a time when a 286 DOS PC was a productivity machine. There’s a huge library of still-useful software for DOS, and thus the prospect of a handheld DOS PC still has some appeal. We’d love to see someone put this in a badge.
Guitar Hero was all the rage for a few years, before the entire world apparently got sick of it overnight. Some diehards still remember the charms of rhythm games, though. Among them you might count [Joseph Valenti] and [Daniel Rodriguez], who built a Keyboard Hero game for their ECE 4760 class at Cornell.
Keyboard Hero differs quite fundamentally from Guitar Hero in one major way. Rather than having the player tackle a preset series of “notes,” the buttons to press are instead procedurally generated by the game based on incoming audio input. It only works with simple single-instrument piano music, but it does indeed work. A Raspberry Pi Pico is charged with analyzing incoming audio and assigning the proper notes. Another Pi Pico generates the VGA video output with the game graphics, which is kept in sync with the audio pumped out from the first Pico so the user can play the notes in time with the music. Rather than a guitar controller, Keyboard Hero instead relies on five plastic buttons assembled on a piece of wood. It works.
It’s obviously not as refined as the game that inspired it, but the procedural generation of “notes” reminds us of old-school rhythm game Audiosurf. Video after the break.
Coming in hot from Cornell University, students [Amanda Huang], [Caroline Hohner], and [Rhea Goswami] bring a project that is guaranteed to tickle the funny bone of anyone in the under-40 set, and sadists of all ages: The Tamagochi Torture Chamber.
He’s dead, Jim.
In case you somehow missed it, Bandai’s Tamagochi is a genre-defining digital pet that was the fad toy at the turn of the millennium, and has had periodic revivals since. Like the original digital pet, there are three pushbuttons to allow you to feed, play with, and clean your digital pet. These affect the basic stats of happiness, health, food and weight in ways that will be familiar to anyone who played with the original Tamagochi. Just as with the original, mistreatment or neglect causes the Tamagochi to “die” and display a tombstone on the TFT display.
Where the “Torture Chamber” part comes in is the presence of an accelerometer and soft physics simulation– the soft physics gets an entire core of the Pi Pico at the heart of this build dedicated to it, while the other core handles all inputs, display and game logic. What this enables is the ability to bounce the digital pet off the walls of its digital home with an adorable squish (and drop in health stat) by tilting the unit. You can check that out in the demo video blow.
Is it overkill for a kids toy to have a full soft body simulation, rather than just a squish-bounce animation? Probably, but for an ECE project, it lets the students show off their chops… and possibly work out some frustrations.
If you’ve got an innovative way to torture video game characters, or a project less likely to get you on Skynet’s hitlist, don’t forget to send in a tip!
Sometimes a project forms itself around a component rather than an idea, and thus it was that [Maximilien] found himself building a data rate monitor for the connection between two data centers. Some MD0657C2-R LED dot matrix displays for not a lot needed a project.
The displays are mounted in groups of four on small PCBs, driven by a MAX6952, which are then controlled by a Pi Pico. There are several display panels in the project, each of which is a pained and laser-etched acrylic sheet with a pair of the LED boards mounted behind it. These in turn go on the front of a wooden enclosure, with a set of LED ring lights behind to illuminate the etched parts of the panels. Each display panel has its own Pico, daisy chained together and driven by a Pico W that supplies network connectivity.
We know [Happy Little Diodes] frequently works with logic analyzer projects. His recent wireless logic analyzer for the ZX Spectrum is one of the oddest ones we’ve seen in a while. The heart of the system is an RP2040, and there are two boards. One board interfaces with the computer, and another hosts the controller.
The logic analyzer core is powered by a common open-source analyzer from [Eldrgusman]. This is one of the nice things about open source tools. Most people probably don’t need a logic analyzer that plugs directly into a ZX Spectrum. But if you do, it is fairly simple to repurpose a more generic piece of code and rework the hardware, if necessary.