For my latest project I needed to connect an RC receiver to an Arduino and read the state of the PWM servo signals. I couldn’t find a library I liked that was interrupt-based, robust, and supported flexible output ranges and remapping. So I decided to build my own.(more…)
I have a friend who likes to stream on Twitch, and he has a problem. Every hour or two he likes to be healthy and take a five minute break – standing up, stretching, going to the bathroom, etc. During this time he mutes his microphone and puts on some background music to keep the audience entertained. But when he comes back he frequently forgets to unmute his microphone so that the stream can hear him. It’s not unusual for him to be talking to himself for five minutes or more until some kind soul in chat speaks up and says “you know you’re muted, right?”
To help him and others who frequently forget to unmute their microphone, I decided to build a physical indicator for the mute status in OBS Studio.(more…)
FrameVis is a Python script for creating visualizations from video frames, also known as “movie barcodes” due to their vertical striping. The script uses the OpenCV library to read from a video file, load frames into memory, and then stack them together to make a new image visualizing the entire film. The resulting visualizations are as fascinating as they are beautiful… you can see the flow of the color grading, the pacing of the editing, and if you know the film well enough you can even pick out certain scenes or even shots.
This script works on Windows, Mac, and Linux and is compatible with all OpenCV file types and codecs. You can download it on GitHub.
Recently I’ve been playing around with building various alternative controller projects for games, typically using an Arduino-compatible microcontroller acting as an HID input device of some sort. The Arduino ecosystem makes it easy to set up these projects to act as either a Keyboard, a Mouse, a DirectInput Joystick, or a composite device that’s a combination of the above. Unfortunately back in 2005 DirectInput was supplanted by XInput with the release of the Xbox 360 controllers, and modern games have been weaning off of it ever since.
These days, many mainstream games barely support DirectInput at all. Games like Rocket League and Overwatch won’t even recognize a DirectInput joystick – you have to use XInput controller emulation software that can be tricky to set up and doesn’t work with every game.
Wouldn’t it be great if there was a simple, turnkey way to make your Arduino emulate an Xbox controller and work out of the box with these newer games?
As I keep working on a number of custom controllers using Arduino boards, I noticed that I tended to build the same sort of data structures every time; things to make it easier to write my own code using the built-in Arduino libraries. One of these bits I kept rebuilding was a wrapper class for the keyboard and mouse libraries that kept track of the keys I was using and their associated output states so that I could set them with a single line of code. Now instead of building yet another version of the same thing for my next project, I decided to turn it into a library instead.
Late last year when I was putting the finishing touches on the McCree Hammershot project, I decided to use a Wii Nunchuk hooked up to an Arduino for the controller’s movement. Although I eventually got it working, I had to try a variety of libraries before I found one that would even read the data properly. Most of them were convoluted, bloated, or poorly documented. Even the library I eventually ended up using was designed for controlling motors with a Nunchuk, not for just reading control inputs.
It’s now many months later, and once again I’m looking to build at least two more projects using extension controllers. So I decided to fix all of these problems and just build my own library.