You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,13 @@ Sketch for Arduino based taiko game controller circuit
4
4
5
5
## Software Setup
6
6
7
+
### Arduino IDE
8
+
7
9
Install the latest version of Arduino IDE from the official website: [https://www.arduino.cc/en/Main/Software](https://www.arduino.cc/en/Main/Software)
8
10
9
-
To enable nintendo switch functionality, replace the following files with the ones provided in "setup" folder:
11
+
### Modifications to Arduino IDE
12
+
13
+
Before starting Arduino IDE, to enable nintendo switch functionality, replace the following files with the ones provided in "setup" folder:
If you've successfully done all the modifications above, you should be able to see the board called "Nintendo Switch Controller" next time you start Arduino IDE:
Please select this board before uploading the code as this is essential for your Arduino Leonardo to be recognized by Nintendo Switch.
27
+
28
+
### Keyboard or Nintendo Switch Controller
29
+
18
30
To enable or disable keyboard and Nintendo Switch controller functionality, remove or add two charactors "//" before these two lines in taiko_controller.ino:
19
31
32
+
- To enable Switch controller only
20
33
```
21
34
//#define ENABLE_KEYBOARD
22
35
#define ENABLE_NS_JOYSTICK
23
36
```
37
+
- To enable keyboard only
38
+
```
39
+
#define ENABLE_KEYBOARD
40
+
//#define ENABLE_NS_JOYSTICK
41
+
```
42
+
- To enable both (not tested)
43
+
```
44
+
#define ENABLE_KEYBOARD
45
+
#define ENABLE_NS_JOYSTICK
46
+
```
24
47
25
48
## Circuit Setup
26
49
50
+
### Materials
51
+
52
+
To setup the circuit, you need an Arduino Leonardo, a set of four piezo sensors, and four 1MΩ resistors for some special cases.
53
+
54
+
### Connect the Circuit
55
+
27
56
Connect the sensors to the 3.3v pin and the analog pins according to the diagram below:
For best performance, the sensors must be piezo sensors (a.k.a. peizo speakers, contact microphones). No guarantee if other types of sensors will simply work, but if analog signals with voltage ranged 0-5V are fed into analog pins, this setup should be good to go.
74
+
### Notes
75
+
76
+
For best performance, the sensors must be piezo sensors (a.k.a. piezo speakers, contact microphones). No guarantee if other types of sensors will simply work, but if analog signals with voltage ranged 0-5V are fed into analog pins, this setup should be good to go.
46
77
47
78
For further improvements, you can use some diodes to limit the voltage of the piezo sensors, or use a 2.5v power supply, but this won't matter in most cases, at least on my side.
48
79
@@ -60,6 +91,8 @@ To deal with four analog inputs, we read the sensor levels one at a time, and on
60
91
61
92
To deal with Nintendo Switch, I used the HID descriptor for Hori's Pokken fightstick to let Switch trust Arduino as a valid controller device (see the [credits](#credits) section). The default buttons from the four sensors are the analog stick buttons (press the sticks down) and the trigger buttons (ZL and ZR).
62
93
94
+
As VID and PID of the controller have to be the specific value, the setup to boards.txt is essential. Also, Switch seems also to be judging the device strictly by the first-come HID descriptor of the device, so Arduino's default HID behavior have to be altered to have our customized HID descriptor to work.
0 commit comments