Writing Python drivers for input devices

[Stealth] put together a post explaining how he writes drivers for input peripherals. He’s using Python which makes the process fairly painless (we’ll get to that in a minute) but the value of his post is in the explanation surrounding how to interpret the data. Once you know how the communications are coming in from a device you can write the driver using any language you want. [Stealth] wrote in to let us know about this post after reading the PlayStation 3 Sixaxis controller sniffing hack. He’s pretty much doing the same thing but the background information is much more bountiful.

There are a couple of prerequisites to the process. First, [Stealth] is working in a Linux environment. That’s not to say you couldn’t do this on another OS, but you’re going to need to do some research to find out how to tap into the data stream from the device. Secondly, the input you are working with must already be set up and working on the machine. That means if there isn’t any support at all for the peripheral (in this case a USB joystick) you’re not going to be able to sniff the commands. That being said, a short Python snippet is all you need to dump the raw data coming in from the device. With data in hand it’s time to do some pattern hunting. As you start to figure out the size and scope of the incoming packets you can try out your own code to make sure you’ve got it right. Check out the demo video after the break which features a joystick button mapper written in Python.

Continue reading “Writing Python drivers for input devices”

Haptic feedback joystick uses air muscles

[Ben Krasnow] is working on a force-feedback joystick. It centers around the concept of an air muscle which transfers pressure into linear motion. He cites another air muscle project as part of the inspiration in his build, but where he’s gone with it is one of the better uses for these blow-up components that we’ve seen.

Basically you have a bladder, in this case rubber tubing. A mesh surrounds it to reinforce the material and cause inflation to shorten the length of the package. In the image above there are four black air muscles that connect the base of a joystick with the outer frame that houses it. How and when each muscle is pressurized determines the type of motion the user will feel on the joystick. This is where his pressure controller comes into play. It uses a voltage-to-pressure transducer to feed a manifold, the combination of which not only makes each muscle addressable but allows him to dial in the force sent to the muscles. Check out the video after the break for his start-to-finish walk through.

Continue reading “Haptic feedback joystick uses air muscles”

Shockingly fun quiz game

Gather your friends round the living room for a head-to-head quiz game. This one’s not quite as nice as you might think. Get an answer wrong and you’re going to get the Venkman treatment thanks to the stored electricity in a disposable camera flash circuit. [Israel] runs the game questions from a Windows machine, and uses a set of four USB joystick buzzers that let each contestant ring in. They all wear a cuff that houses electrodes for negative-reinforcement upon an incorrect answer. Since every contestant answers each question it won’t be long before you hear the uncomfortable yelp of failure from your guests. This seems a little bit more fair than shocking people for not calming their minds, but the video from that hack is still one of our all-time favorites.

Talking joystick mouse

Instructibles user [Shadowwynd] shows us a great way to build a joystick/mouse device for people with special accessibility needs. When faced with a case that involved a man with very limited mobility as well as a limited budget, [shadowwynd] set out to find a cost effective solution to computer navigation. They found that his client could use a commercial joystick mouse, but the cost was quite high at over $400. So instead of just purchasing that, they bought a USB game pad and built their own version. They managed to reduce the cost to roughly $45.  While extending the buttons and joystick from a gamepad might not be groundbreaking, we feel that this project is the epitome of hacking. Great job [Shadowwynd] keep up the good work.

Replace an N64’s worn out joystick

As gaming consoles age the controllers will inevitably show some wear, and sadly may give out all together. [Kyle] couldn’t bear to watch his Nintendo 64 controller bite the dust so he replaced the thumb stick with one from a PlayStation. This is a bigger job than you might imagine because the two parts are fundamentally different. The original N64 stick uses a rotary encoder to output data to the control chip, while the PlayStation stick is an analog device. [Kyle’s] solution was to read the analog values using a PIC, but lower in the thread you can read about another user who pulled off a similar hack using an AVR. Both convert the signals into the rotary encoder format that the N64 chip is listening for. From the looks of the clip embedded after the break, this couldn’t work any better!

Continue reading “Replace an N64’s worn out joystick”

iPhone tilt motion controller

Here’s a mounting system that adds mechanical tilt control to the iPhone. It uses two servo motors to rotate along the X and Y axes. An analog joystick is used along with an Arduino to control the movement of the apparatus. As you can see in the video after the break, this works quite well when playing accelerometer-based games. But adding a joystick isn’t the end-goal of the project. [Shane] plans to point a camera at the iPhone and use image recognition to play games automatically. That sounds like a big bite the chew but we’ve seen this work with Guitar Hero so we’re optimistic.

Continue reading “iPhone tilt motion controller”

More bike-controlled Google-travelling

This is becoming such a popular hack we figure someone needs to come up with a name for it like Google-travelling or Google-cising (exercising with Google). It’s a bike controller for Google Earth. [Braingram] broke out his road bike, setting it up in the trainer in front of his laptop. If you already have a computer with a cadence sensor this will be a snap. These measure the crank rotation using a magnet and reed switch. So as not screw up his summer biking [Braingram] spliced into the sensor while leaving it attached to the bike computer. From there it is read by an Arduino which also monitors an analog joystick attached to the handlebars. A little bit of Python scripting and you’ll be ready to go.

Be sure to check out some of the other variants like using an exercise bike, or adding a wearable display.