Using A TeensyLC To Emulate The XBOX 360 Controller

After the release of Mortal Kombat X, [Zachery’s] gaming group wanted to branch out into the fighter genre. They quickly learned that in order to maximize their experience, they would need a better controller than a standard gamepad. A keyboard wasn’t going to cut it either. They wanted a fight stick. These are large controllers that look very much like arcade fighting controls and include a joystick and large buttons. [Zachery’s] group decided to build their own fight stick for use with a PC.

[Zachery] based his build around the TeensyLC, which is a 32 bit development board with an ARM processor. It’s also compatible with Arduino. The original version of his project setup the controller as a HID, essentially emulating a keyboard. This worked for a while until they ran into compatibility issues with some games. [Zachery] learned that his controller was compatible with DirectInput, which has been deprecated. The new thing is Xinput, and it was going to require more work.

Using Xinput meant that [Zachery] could no longer use the generic Microsoft HID driver. Rather than write his own drivers, he decided to emulate the XBOX 360 controller. When the fight stick is plugged into the computer, it shows up as an XBOX 360 controller and Windows easily installs the pre-built driver. To perform the emulation, [Zachery] first had to set the VID and PID of the device to be identical to the XBOX controller. This is what allows the Microsoft driver to recognize the device.

Next, the device descriptor and configuration descriptor had to be added to the Teensy’s firmware. The device descriptor includes information such as USB version, device class, protocol, etc. The configuration descriptor includes additional information about the device configuration. [Zachery] used Microsoft Message Analyzer to pull the configuration descriptor from a real XBOX 360 controller, then used the same data in his own custom controller.

[Zachery] programmed the TeensyLC using the Arduino IDE. He ran into some trouble here because the IDE did not include the correct device type for an Xinput device. [Zachery] had to edit the boards.txt file and add three lines of code in order to add a new hardware device to the IDE’s menu. Several other files also had to be modified to make sure the compiler knew what an Xinput device type was.  With all of that out of the way, [Zachery] was finally able to write the code for his controller.

An Electronic Woodwind With An Onboard Synthesizer

About a year ago, we saw a project on for a MIDI wind controller. Keyboard MIDI controllers are a dime a dozen, but if you want something that actually sounds like a brass or woodwind instrument, you need something that’s controlled by a breath sensor. Since then, this project has been updated with an onboard synthesizer. It sounds great, and thanks to some interesting components, the part count is actually really low.

The synthesizer used for this project is just a single chip – the DSP-G1 from [Jan Ostman]. This isn’t a custom ASIC or anything fancy; it’s just an 8-pin ARM microcontroller in DIP format, the LPC810.

The rest of the instrument is just a series of pressure sensors along the body, and a breath sensor. The plan is to stuff all the electronics – a microcontroller to read the touch and breath sensors, the DSP-G1 chip, and the battery  – inside the body of the instrument. That’s something that would be incredibly cool, and much more capable than the wind controllers that are available today.

You can see a few videos of the wind controller below.

Continue reading “An Electronic Woodwind With An Onboard Synthesizer”

Hackaday Prize Entry: A Bit Dingus

There was a time when just about every computer – even laptops – came with a parallel port. That’s 25 pins of bit-banging goodness, accessible from every programming environment, that could control any random pile of electronics sitting on a desk. The days of parallel ports are behind us now, and if you want to blink a pin with a computer, you’re looking at controlling a microcontroller over USB or something.

[ajlitt]’s Tiny Bit Dingus is just that: a microcontroller stuffed into a USB plug with a few pin headers. With the right app, you can control these pin headers over USB. It’s the closest you’re going to get to a parallel port with modern hardware.

This bit dingus isn’t meant to replace the Bus Pirate, an Arduino, or anything else; it’s meant to be a small and simple way to connect random electronics to a computer with as few parts as possible. If you’re looking for a part to add to your electronic tinkerer everyday carry rig, this would be it.

There’s a few bits of interesting hardware inside the Bit Dingus. A while back, [ajltt] ran into the Freescale KL27, a Cortex M0+ that does USB without a crystal, has a USB bootloader, and doesn’t require many additional components at all. It’s the perfect size for the project at 5x5mm, and is unbrickable while still being flashable over USB.

The 2015 Hackaday Prize is sponsored by:

A Very, Very Small IMU

The reason we’re playing with quadcopters, flight controllers, motion controlled toys, and hundreds of other doodads is the MEMS revolution. A lot is possible with tiny accelerometers and gyroscopes, and this is looking like the smallest IMU yet. It’s an 18mm diameter IMU, with RF networking, C/C++ libraries, and a 48MHz ARM microcontroller – perfect for the smallest, most capable quadcopter we’ve ever seen.

The build started off as an extension of the IMUduino, an extremely small rectangular board that’s based on the ATMega32u4. While the IMUduino would be great for tracking position and orientation over Bluetooth, it’s still 4cm small. The Femtoduino cuts this down to an 18mm circle, just about the right size to stuff in a model rocket or plane.

Right now, femtoIO is running a very reasonable Kickstarter for the beta editions of these boards with a $500 goal. The boards themselves are a little pricey, but that’s what you get with 9-DOF IMUs and altimeter/temperature sensors.

Interview with the Creators of CHIP, a $9 Single-Board Computer

Single-board computing is hot on the DIY scene right now and riding that knife edge is C.H.I.P., a project currently in crowd-funding which prices the base unit at just $9. I was happy to run into the crew from Next/Thing Company who developed C.H.I.P. They were happy because, well, the project’s reception has been like a supernova. Right now they’re at about $1.5M of their original $50k goal. We spoke about running Linux on the board, what connectors and pinout headers are available, as well as the various peripheral hardware they have ready for the board.

Continue reading “Interview with the Creators of CHIP, a $9 Single-Board Computer”

Hacklet 46 – ODROID Projects

It seems you can’t mention the Raspberry Pi these days without someone bringing up the Odroid. Named after the combination of Open and Android, the current Odroid brand covers several boards – the U3, the UX3 with its 2 Ghz Samsung quad-core processor, and the C1, which is directly aimed at our favorite fruit pie computer. With all this popularity, one would expect a few awesome projects based around the Odroid machines, and you’d be right! This week’s Hacklet is all about projects using the Odroid on!

Robbie jrWe start with [herrkami] and CRONUS. Cronus started life as a Robbie Junior, Radio Shack’s re-branded version of Takara Tomy’s Omnibot Jr.  [herrkami] has upgraded Cronus’ brain with an Odroid U3. Cronus can now reliably respond to voice commands thanks to a little help from Google’s speech recognition engine and the accompanying Python API. Cronus is rather conversational as well, all due to the AIML framework. [herrkami] hopes to cut the cord (or WiFi link) once he gets CMU sphinx up and running. Some of [herrkami’s] best work is in his cardboard templates to create a mechanism for turning Cronus’ head. These are some pretty sweet updates for a 1986 vintage robot!


serverNext up is [tlankford01] with Linux Tutorial: Odroid U3 Server w/ Seafile Cloud. [tlankford01] walks us through setting up a file server using the Odroid, a 16 Gigabyte EMMC card, and a hard drive to hold the files. As one might expect, this tutorial covers a LAMP (Linux, Apache, MySQL, PHP) server stack. The 9 project logs take us from a bare microSD card to a full server. The Odroid’s 2 Gigabytes of ram are put to good use running the open source Seafile cloud server package. Tutorials like this deserve lots of love from the community. Sometimes you just need to get a solid file server up and running. When that happens, this type of project is often just what the doctor ordered! So don’t be a lurker, head over to [tlankford01]’s page and give him a skull!


touch[Victor] gets us one step closer to an Odroid tablet with the HDMI touchscreen. HDMI touchscreen is a project to connect a 7″ 1024 x 600 LCD with a capacitive touchscreen to HDMI based computers. The heart of the project is Texas Instrument’s TFP401 panelbus DVI receiver chip. This chip makes interfacing LCD screens to HDMI or DVI video cards (almost) painless. There still is a bit of X configuration to do to get things running. [Victor] even got his Odroid running in Android with his custom screen setup. Those of us who have spent time in display an input configuration file limbo know that this is no small feat!

htpcFinally we have [darth_llamah] with Odroid-U3 HTPC. [Darth] raided his junkbox and parts drawers to build a solid home theater PC using the Odroid-U2. The U2 is a bit older than the current U3 models, but all [Darth’s] work should apply to any of the Odroid series. An old Itona case provided the frame for this hack, but it took a lot of custom work with plastic and epoxy to make everything fit. [Darth’s] software stack is the popular OpenELEC Linux build. [Darth] even setup a real “soft” power button using an ATtiny85 connected to USB and s Adafruit’s TrinketHidCombo library.

If you want to see all the Odroid projects in one place, check out our new Odroid projects list!

That’s it for this Hacklet, As always, see you next week. Same hack time, same hack channel, bringing you the best of!

Extreme Vectrex Multicart Plays Bad Apple

[Sprite_TM] had a Vectrex console that he wanted to play with. Alas, his makeshift multicart had fallen into disrepair. Rolling up his hacking sleeves, he set about making a new one, a better one. His PCB design included his microcontroller of choice: the ST STM32F411, a 32-bit 100Mhz ARM Cortex M4, along with a 16MB SPI flash chip. [Sprite_TM] wanted to make programming games onto the multicart simple. Using the libopencm3 firmware library for the STM in conjunction with Elm-Chans FatFS, the multicart could be plugged into a computer’s USB port and have any game data dragged and dropped onto it like a USB stick. The PCB then connects directly into the Vectrex’s cartridge port. The first cartridge file is a basic menu that lists all of the game ROMs stored in the flash memory. When the user selects the game the STM loads that ROM file which the menu software then boots.

After loading his entire Vectrex ROM library onto the multicart, [Sprite_TM] realized he had far too much space left over – so he decided to add some extras. His first choice was Bad Apple (YouTube link), a music video made by fans of the Touhou Project game series. The video features black and white silhouettes of the many game characters in a shadow art style. Since its debut, Bad Apple has been ported from everything from the Sega Genesis (YouTube link) to laser scanners (YouTube link). It was time for the Vectrex to join the list.

After ripping the video from YouTube, [Sprite_TM] used MPlayer to save each frame as a PNG along with a wave file of the music. Next, he ran Potrace on the PNG files to get vector versions. Using a custom PHP script, the resulting JSON file was post-processed into relative vectors the Vectrex uses. Digital audio was possible by having the Vectrex’s 8-bit DA-converter perform double duty both for the video circuit and the audio. However, the volume must be turned to the max in order to hear the music. Incidentally, the DAC can only output audio in this scenario when vectors are not being drawn, so the event timing needed to be adjusted. The video and audio data was re-parsed after a modified version of VecX was used to get the timing events synchronized before transferring Bad Apple onto the multicart.

You can see the Vectrex version of Bad Apple after the break, along with a 3D-engine based on Doom levels. The engine is written in C and makes use of the Z-buffer, creating the effect of solid 3D-objects in front of each other.  There are no weapons or enemies to dispatch here, but the effect is impressive nonetheless.

Continue reading “Extreme Vectrex Multicart Plays Bad Apple”