1
0
mirror of https://github.com/limyz/573controller synced 2024-09-24 03:08:25 +02:00

Added _sdvx and supplementary images

This commit is contained in:
limyz 2020-04-27 11:33:18 +08:00
parent c27baae6af
commit 889cad7c5d
6 changed files with 165 additions and 7 deletions

View File

@ -1,15 +1,22 @@
# 573controller
This repository houses several .ino files for use with an Arduino. Supported music game controllers include:
This repository houses several Arduino .ino files for use with an Arduino Leonardo or Micro to transform it into music game controller. Supported controllers include:
* _gfxg
Allows you to use an Arduino Leonardo or Micro to transform a Guitar Hero/GuitarFreaks/Gitadora guitar into a USB game controller
Allows you to transform it into a a USB game controller for use with [Clone Hero](https://clonehero.net)/[DTXAL](http://senamih.com/dtxal)/Guitar Hero/GuitarFreaks/Gitadora.
* _iidx
Allows you to use an Arduino Leonardo or Micro to transform an IIDX controller into a USB game controller with full support for [beatmania IIDX INFINITAS](https://p.eagate.573.jp/game/eac2dx/infinitas).
Allows you to transform it into a IIDX controller with full native support for [beatmania IIDX INFINITAS](https://p.eagate.573.jp/game/eac2dx/infinitas).
* _iidx_2p
Similar to _iidx but with buttons remapped from E1/E2 to E3/E4 for use with doubles play (DP).
Similar to _iidx but with buttons remapped from E1/E2 to E3/E4 for use with doubles play (DP). For players using the 2P side for single play, simply modify E3/E4 to E1/E2 button mappings.
* _sdvx
Allows you to transform it into a SDVX controller with full native support for [SOUND VOLTEX III](https://p.eagate.573.jp/game/eacsdvx/iii).
## Requirements
* Arduino Leonardo or Micro
@ -17,4 +24,8 @@ Similar to _iidx but with buttons remapped from E1/E2 to E3/E4 for use with doub
If you are using _iidx, it additionally requires:
* [Quadrature Encoder Library for Arduino](https://github.com/PaulStoffregen/Encoder)
* Replacement of `boards.txt` located in your `Arduino/hardware/avr` directory. This modifies the pid (Product ID) and vid (Vendor ID) for [beatmania IIDX INFINITAS](https://p.eagate.573.jp/game/eac2dx/infinitas) to accept in-game input.
* Replacement of `boards.txt` located in your `Arduino/hardware/avr` directory. This allows [beatmania IIDX INFINITAS](https://p.eagate.573.jp/game/eac2dx/infinitas) to accept in-game input natively.
If you are using _sdvx, it additionally requires:
* [Quadrature Encoder Library for Arduino](https://github.com/PaulStoffregen/Encoder)
* Replacement of `boards.txt` located in your `Arduino/hardware/avr` directory. This allows [SOUND VOLTEX III](https://p.eagate.573.jp/game/eacsdvx/iii) to accept in-game input natively.

View File

@ -122,7 +122,7 @@ void loop() {
}
}
if (turnTable.read() >= 360 ) {
if (turnTable.read() >= 360) {
turnTable.write(-360);
}
else if (turnTable.read() <= -360) {

View File

@ -112,9 +112,11 @@ void loop() {
digitalWrite(A1, HIGH);
break;
case 7:
// set to button 8 if using for single play
Joystick.setButton(10, currentButtonState);
break;
case 8:
// set to button 9 if using for single play
Joystick.setButton(11, currentButtonState);
break;
}
@ -122,7 +124,7 @@ void loop() {
}
}
if (turnTable.read() >= 360 ) {
if (turnTable.read() >= 360) {
turnTable.write(-360);
}
else if (turnTable.read() <= -360) {

145
_sdvx/_sdvx.ino Normal file
View File

@ -0,0 +1,145 @@
//--------------------------------------------------------------------
// For use with a 573 SDVX Controller
//
// This sketch maps 2 rotary encoders and uses 14 digital
// inputs. (7 for the keys and 7 for its LEDs)
//
// All digital pins are grounded when they are pressed.
//
// NOTE: This sketch file is for use with Arduino Leonardo or Micro
// only.
//
// by lyzzz
// 2020-04-26
//--------------------------------------------------------------------
#define ENCODER_OPTIMIZE_INTERRUPTS
#include <Encoder.h>
#include <Joystick.h>
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,JOYSTICK_TYPE_GAMEPAD,
10, 0, // Button Count, Hat Switch Count
true, true, false, // X, Y and Z Axis
false, false, false, // No Rx, Ry, or Rz
false, false, // No rudder or throttle
false, false, false); // No accelerator, brake, or steering
void setup() {
// Initialize Pins
// FX and Start Buttons
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
// FX and Start LEDs
pinMode(A3, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A0, OUTPUT);
pinMode(15, OUTPUT);
pinMode(14, OUTPUT);
pinMode(16, OUTPUT);
// VOL-L Rotary Encoder
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
// VOL-R Rotary Encoder
pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);
// Initialize Joystick Library
Joystick.begin();
Joystick.setXAxisRange(-360, 360);
Joystick.setYAxisRange(-360, 360);
}
// Constant that maps the phyical pin to the joystick button.
const int pinToButtonMap = 4;
// Last state of the buttons
byte keys[] = {4, 5, 6, 7, 8, 9, 10};
byte LEDs[] = {A3, A2, A1, A0, 15, 14, 16};
int lastButtonState[7] = {0,0,0,0,0,0,0};
Encoder volL(0,1);
Encoder volR(2,3);
long previousMicros = 0;
long interval = 100000; // interval at which to blink (microseconds)
void loop() {
unsigned long currentMicros = micros();
// Read pin values
for (int index = 0; index < 7; index++) {
int currentButtonState = !digitalRead(index + pinToButtonMap);
if (currentButtonState != lastButtonState[index]) {
switch (index) {
// Start
case 0:
Joystick.setButton(0, currentButtonState);
digitalWrite(A3, HIGH);
break;
// BT-A
case 1:
Joystick.setButton(1, currentButtonState);
digitalWrite(A2, HIGH);
break;
// BT-B
case 2:
Joystick.setButton(2, currentButtonState);
digitalWrite(A1, HIGH);
break;
// BT-C
case 3:
Joystick.setButton(3, currentButtonState);
digitalWrite(A0, HIGH);
break;
// BT-D
case 4:
Joystick.setButton(4, currentButtonState);
digitalWrite(15, HIGH);
break;
// FX-L
case 5:
Joystick.setButton(5, currentButtonState);
digitalWrite(14, HIGH);
break;
// FX-R
case 6:
Joystick.setButton(6, currentButtonState);
digitalWrite(16, HIGH);
break;
}
lastButtonState[index] = currentButtonState;
}
}
if (volL.read() >= 360) {
volL.write(-360);
}
else if (volL.read() <= -360) {
volL.write(360);
}
if (volR.read() >= 360) {
volR.write(-360);
}
else if (volR.read() <= -360) {
volR.write(360);
}
Joystick.setXAxis(volL.read());
Joystick.setYAxis(volR.read());
if(currentMicros - previousMicros > interval) {
previousMicros = currentMicros;
// set the LED with the ledState of the variable:
for(int index = 0; index < 7; index++) {
digitalWrite(LEDs[index], LOW);
}
}
}

BIN
images/573_lis3lv02dl.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
images/573_tg87a.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB