So, after my final year of schooling and the release of my first mobile video game, I decided it was time to finish some of my hardware tinkering projects. This shifter, now a $30 project, was used quite a bit in the form shown in this post (with the addition of a shifter knob off a Toyota MR-S). The shifter software was always a problem though. It was a hacked solution anyway so that is no surprise.
I thought I could do better so I swapped out the USB controller board for a Teensy 2.0
. This board benefits from all the Arduino libraries, but is small, cheap, has a lot of pins, and a great layout.
Instead of simulating a game controller I'm using the Teensy to emulate a USB keyboard. This should mean greater compatibility with PC games since there are quite a few that do not allow controls to be mapped to two, and some cases three, different controllers (ie Steering Wheel, pedals, shifter).
I gave it two modes, "Sequential Shifting" and "Non-Sequential Shifting". Sequential maps only two keys for shifting up and down (A and Z for instance) and non-sequential maps a separate key for each gear lever position. This should allow compatibility with virtually any racing game. When the mode select button is pressed it switches between these two modes and the mode is indicated via the LED. The last selected mode is saved in EEPROM so that next time the shifter is plugged in, it loads that mode.
There is also a "Reset to Neutral" button that you would press if the gear selected on the Teensy goes out of sync with the gear in game. Just put the stick in neutral and press the button and the in game gear will set to neutral. *this is just a precaution and shouldn't be problem most of the time*
I'm reluctant to post the code for this shifter just yet since I haven't tested it in but a few games. It needs a bunch of testing but it does work now so HERE is the sketch
. In a day or two, I'll follow this up with a post that updates the original post and gives the finished source.
It just so happens that I started thinking about this project again around the time theFubarino contest was announced
. My entry is pretty simple but still cool (I think so at least :p ).
When the shifter is in non-sequential mode, shift through the following gears: 1, 3, 3, 7 and then wait a couple seconds. The Teensy will launch IE and type in the HaD web address. While each character of the address is being typed, the LED flashes the corresponding Morse code using the great and easy to use Morse EnDecoder
. Why does it use Morse code? Why not?
Coincidentally, since each character takes a different length of time to complete its Morse code, the "typing" of the characters isn't at a constant speed and it gives a pretty good illusion of a human typing. I'm not sure what uses that might have but I'll keep it in the back of my mind.