snes-controller-usb-adapter

所属分类:超算/并行计算
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2023-12-04 17:48:03
上 传 者sh-1993
说明:  在现代计算机上通过USB使用Super NES控制器的转换器
(A converter to use the Super NES controller via USB on a modern computer)

文件列表:
LICENSE (1072, 2023-12-07)
imgs/ (0, 2023-12-07)
imgs/prototype-front.jpeg (2310030, 2023-12-07)
imgs/prototype-top.jpeg (2371211, 2023-12-07)
sketches/ (0, 2023-12-07)
sketches/main/ (0, 2023-12-07)
sketches/main/hardware.h (143, 2023-12-07)
sketches/main/main.ino (6171, 2023-12-07)

# SNES Controller to USB Adapter This is a simple adapter to use a [Super NES][1] controller with a computer via USB. It is based on the [ATmega32U4][2] microcontroller and uses the Arduino [`Keyboard.h`][3] library to emulate a keyboard. It should work with both PAL and NTSC controllers, but I have only tested it with a PAL controller. [1]: https://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System [2]: https://www.microchip.com/en-us/product/atmega32u4 [3]: https://www.arduino.cc/reference/en/language/functions/usb/keyboard/ ## Hardware

Prototype board front Prototype board top

I used an [Arduino Pro Micro][4] clone, but any ATmega32U4-based board should work, e.g. an Arduino Leonardo. You can modify the pin assignments in [`hardware.h`][5], further instruction on how to wire the controller to the board can be found in the [main sketch][6]. The "lock" pin is a simple pull-up digital input. When it is not pulled low, the controller is locked and no input is sent to the computer. This is useful when reflashing the board in case of malfunctioning code. You can short it to ground if you do not plan to change the code. Some boards do not have a reset button, you can add one placed between the reset pin and ground. [4]: https://www.sparkfun.com/products/12640 [5]: sketches/main/hardware.h [6]: sketches/main/main.ino ## Software ### Button -> Keyboard mapping As of current version, the adapter maps the controller buttons as follows: | SNES button | Keyboard key | | ------------ | ------------ | | L | l | | R | r | | Joypad Up | Up arrow | | X | x | | Joypad left | Left arrow | | Joypad right | Right arrow | | Select | Right shift | | Start | Enter | | Y | y | | A | a | | Joypad down | Down arrow | | B | b | ### LED feedback | LED state | Meaning | | --------- | ------------------------ | | Off | No power | | On | Power | | 1 Hz | Controller not connected | | 2 Hz | Locked (internal switch) | ### Compiling and flashing You can use the Arduino IDE to compile and flash the adapter. You will probably need to upload the sketch as on Arduino Leonardo. Also, if having trouble flashing the board, be aware of [this issue][7]. [7]: https://forum.arduino.cc/t/arduino-pro-micro-not-recognized/698335

近期下载者

相关文件


收藏者