[Garrett Greenwood] plays Smash Brothers, and apparently quite seriously. So seriously that he needed to modify his controller with five Neopixels so that it flashed different color animations according to the combo he’s playing on the controller; tailored to match the colors of the moves of his favorite character, naturally.
All of this happens with an ATtiny85 as the brains, which we find quite ambitious. Indeed, [Garrett] started out thinking he could simply read each of the inputs from the controller directly into the microcontroller at the heart of the whole thing, but then counted up how many wires that would be, and looked at how many pins he had free (six), and thought up a better solution.
[Garrett]’s routine instead reads the single line that the Gamecube controller uses to send back to the console. The protocol is well understood, using long-short and short-long signals to encode bits. The only trick is that each bit is sent in four microseconds, so the decoding routine has to be fairly speedy. To make it work he had to do quite a bit of work. More about that, and the demo video, after the break.
[Garrett]’s current post only covers the hardware and use of the thing. We’re waiting with baited breath for the software writeup. To whet your own whistle, check out [Garrett]’s Github and browse through the code yourself. Our cursory read-through includes the following highlights:
- Gamecube protocol handled in an interrupt routine written in assembler
- Animations handled using the Protothreads library for lightweight microcontroller threads
- Generally sexy coding, including a nice hand-built Makefile (the way we like ’em)
We don’t know how much free space you have, [Garrett], but we think it’d be cool if you could squeeze a serial bootloader into the chip, so that you can update it more easily without opening and closing the case. TinySafeBoot or (going old-school) [Peter Dannegger / “Danni”]’s fastboot might do you well.
Oh, and [Garrett] emailed us to say he’s looking around for a plastics company to manufacture transparent backs for Gamecube controllers like his, and is thinking of running a Kickstarter if he can find one. Keep your eyes out.
Thanks [Bigjosh2] for the tip!
Filed under: misc hacks, nintendo hacks, peripherals hacks
No comments:
Post a Comment