ZarkWizard wrote:As promised here is the Teensy code.. It's a wee bit more complex looking that the code that was posted, but I am sure you will find that it is much more flexible in design.
A couple of things to keep in mind when using this code. If you are using analog sticks they must be defined on the right side of the teensy. Ports start from A0 (digital pin 21) and go down to A10 (digital pin 11) A11 = Digital pin 22.. Just remember to reference them as 0-11 when calling the analog reads.
The code may seem a little daunting, but if you pin up your teensy, then uncomment DEBUG_BUTTONS, you can basically run the teensy connected to your computer while you put the cursor beside what you are trying to set the key for and it'll put the pin number in the code for you. I call it lazy mans coding.. who really wants to screw with figuring out the pin locations..
A few things the code does when running...
- If you hold down the power button on the Wii-U Controller you can toggle modes
- While holding power press
START to enable MAME Mode (D-PAD Becomes Keys)
- While holding power press
SELECT to disable MAME Mode (D-PAD becomes buttons)
- While holding power you can click the left stick and it will toggle between Joystick and Keyboard modes
- While holding power you can click the right stick and it will toggle between PSX and N64 modes default is N64, if you want to change the default change the variable
GameState
That brings me to another point. I wired up the TV, Power, and Home buttons as well. It's not listed in the above docs, but I included an image in this message with the pin locations on the FRC. Remember to connect your ground (any one of the 3 pins to any ground on the teensy). I used the following Teensy pin locations for the buttons:
- // ------------- Bottom Row
const int ButHome = 8;
const int ButTV = 9;
const int ButPower = 10;
Keep in mind this code is designed for a
Teensy 2.0 I have no idea if it will work on any other.
Please see Teensy coding thread for latest code:
http://www.sudomod.com/forum/viewtopic. ... 956#p23956
Dunno if I should make another thread with the code, or if banjokazooie wants to update the code for his teensy that he has in the first post. If you use this code and follow all the pinouts it will actually map to the teensy that is pictured, and work as expected.
If you have questions about the code please feel free to ask.
-- Edited Teensy code new functions... v1.3 --
CHANGES:
ADDED DIRECTION PAD SUPPORT ACROSS ALL MODES
ADDED HOME BUTTON KEY COMMANDS
ADDED MAME MODE BUTTON SETTING FOR D-PAD