fluffymadness / ATMega32U4-Switch-Fightstick

ATMega32U4-Switch-Fightstick
64 stars 15 forks source link

Switch Fightstick Code (Atmega32U4)

This one is a working switch fightstick sketch flashable via Arduino IDE. I personally use it on a pro micro clone microcontroller that can be bought for 2-3$ on aliexpress. My motivation was to have a working solution for dirt-cheap easy source-able parts. Well here it is.

The Code itself has proper Button-Debounce, and 3 Modes of input.

You can switch seamlessly between the 3 modes by pressing START+SELECT.

Building Instructions

Pinmapping

Here is the Pinnumbers to Button Mapping for Connecting the actual physical cables to a Pro Micro. joystickUP.attach(0,INPUT_PULLUP);

joystickDOWN.attach(1,INPUT_PULLUP);

joystickLEFT.attach(2,INPUT_PULLUP);

joystickRIGHT.attach(3,INPUT_PULLUP);

buttonA.attach(5,INPUT_PULLUP);

buttonB.attach(4,INPUT_PULLUP);

buttonX.attach(7,INPUT_PULLUP);

buttonY.attach(6,INPUT_PULLUP);

buttonLB.attach(9,INPUT_PULLUP);

buttonRB.attach(8,INPUT_PULLUP);

buttonLT.attach(14,INPUT_PULLUP);

buttonRT.attach(10,INPUT_PULLUP);

buttonSTART.attach(15,INPUT_PULLUP);

buttonSELECT.attach(16,INPUT_PULLUP);

buttonHOME.attach(18,INPUT_PULLUP);

Credits

Special thanks to shinyquagsire's and progmem's reverseengineering work for the pokken tournament controller. (https://github.com/progmem/Switch-Fightstick)

Dean Camera for the LUFA Library

zlittell, msf-xinput was very helpful for starting.

thomasfredericks for the Bounce2Lib.