Skip to content

Commit 72f8f9f

Browse files
committed
Add README
1 parent e493e7e commit 72f8f9f

File tree

4 files changed

+176
-14
lines changed

4 files changed

+176
-14
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Switch Serial Controller
2+
3+
A device and web application for operating Nintendo Switch from a browser.
4+
5+
![ScreenShot](./img/screenshot.png)
6+
7+
Read each README's for more details.
8+
9+
Device: [README](./device/README.md)
10+
11+
Web Server: [README](./controller/README.md)

controller/README.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Switch Serial Controller - Server
2+
3+
A web application that can manipulate Nintendo Switch from web page.
4+
5+
## Getting Started
6+
7+
```sh
8+
git clone --recursive https://github.com/r-ralph/Switch-Serial-Controller.git
9+
cd Switch-Serial-Controller
10+
cd controller
11+
./gradlew :server:run
12+
```
13+
14+
Then, open `http://localhost:8080`
15+
16+
## How to use
17+
18+
1. Prepare a device is treated as the Pro Controller.
19+
20+
See [device's README](../device/README.md)
21+
22+
2. Connect the device to Switch and PC.
23+
3. Run server
24+
25+
```sh
26+
# For Windows(cmd.exe)
27+
gradlew :server:run
28+
29+
# For *nix
30+
./gradlew :server:run
31+
```
32+
33+
4. Access to `http://localhost:8080`.
34+
5. Select corresponding port id and control gamepad view.
35+
6. Click `SEND` button.
36+
37+
## Features
38+
39+
| ![ScreenShot](../img/screenshot.png) |
40+
|:-----------|
41+
42+
### Control View
43+
44+
- Serial Port
45+
- A name of serial port which send any commands to.
46+
- Direct Send
47+
- If turned on, send a command immediately when you change any button in Gamepad view.
48+
- Hold Gamepad Input
49+
- If turned on, button, stick, and hat buttons becomes like toggle button.
50+
- If turned off, it behaves like real controller.
51+
52+
### Gamepad View
53+
54+
#### Buttons
55+
56+
If it is dark gray, it is pressed.
57+
58+
#### Sticks
59+
60+
Click and hold a black reticle to move.
61+
A button at the bottom right if for pressing stick.
62+
Click bottom left button (`+`) to reset the reticle to the center.
63+
64+
#### Current input text view
65+
66+
The current gamepad input values are displayed below the gamepad. It can be used as a macro command.
67+
68+
### Macro View
69+
70+
Puts macro text and click `START MACRO` to process commands in the order.
71+
If there is no more command that can be executed, stop executing the macro.
72+
73+
#### Macro commands
74+
75+
The following commands are available.
76+
77+
- Change State
78+
- Puts the controller in the specified state
79+
- Joins the following keys with a semicolon.
80+
- Buttons
81+
- `A,B,X,Y,L,R,ZL,ZR,CLICK,RCLICK,START,SELECT,HOME,CAPTURE`
82+
- 8-direction hat
83+
- `HAT@{direction:0-8}`
84+
- 8 means center and top is 0. The numbers increase clockwise.
85+
- Sticks
86+
- `{L|R}STICK@{degrees:0.0-360.0},{tilt:0.0-1.0}`
87+
- When the tilt is 1, the stick is completely toppled.
88+
- Wait
89+
- Waits specified milli seconds to do next command.
90+
- `wait {number}`
91+
- Label
92+
- Indicates the location where you can move by Goto command.
93+
- `:{label name}`
94+
- Goto
95+
- Jumps to the specified label position.
96+
- `goto {label name}`
97+
- Comment
98+
- These lines are ignored as comment.
99+
- Starts with `#` or empty line.
100+
101+
#### Macro example
102+
103+
```
104+
# Press the A,B,X,Y button in sequence every second.
105+
106+
:head
107+
A
108+
wait 1000
109+
B
110+
wait 1000
111+
X
112+
wait 1000
113+
Y
114+
wait 1000
115+
goto head
116+
```
117+
118+
```
119+
# Keep the left stick up, and click the A button repeatedly.
120+
121+
:head
122+
A;LSTICK@90,1
123+
wait 50
124+
LSTICK@90,1
125+
wait 50
126+
goto head
127+
```
128+
129+
## LICENSE
130+
131+
```
132+
Copyright 2020 Tamaki Hidetsugu / Ralph
133+
134+
Licensed under the Apache License, Version 2.0 (the "License");
135+
you may not use this file except in compliance with the License.
136+
You may obtain a copy of the License at
137+
138+
http://www.apache.org/licenses/LICENSE-2.0
139+
140+
Unless required by applicable law or agreed to in writing, software
141+
distributed under the License is distributed on an "AS IS" BASIS,
142+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
143+
See the License for the specific language governing permissions and
144+
limitations under the License.
145+
```

device/README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
# Switch-Fightstick
2-
[![Thumbnail](https://i.imgur.com/cJLZUdhl.jpg)](https://twitter.com/ebith/status/954858876028907521)
3-
- [Xenoblade Chronicles 2](https://twitter.com/ebith/status/954858876028907521)
4-
- [Octopath Traveler](https://twitter.com/ebith/status/1079163336862818305)
1+
# Switch Serial Controller - device
2+
3+
A device for manipulating Nintendo Switch via serial communication.
4+
5+
Based on [ebith's PoC](https://github.com/ebith/Switch-Fightstick).
56

67
## Requirement
78
- ATMega32U4 Board or see [shinyquagsire23/Switch-Fightstick's README](https://github.com/shinyquagsire23/Switch-Fightstick/blob/master/README.md)
89
- USB to serial adapter
910
- USB micro-b cable * 2
1011

11-
## Usage
12-
[NintendoSwitchをPCから操作する - おいら屋ファクトリー](https://blog.feelmy.net/control-nintendo-switch-from-computer/)(in Japanese)
12+
## How to build
13+
14+
### Make a device
15+
16+
TBD
17+
18+
### Build firmware and flush
1319

14-
### On MacOS
1520
```sh
16-
brew install avr-dude osx-cross/avr/avr-gcc
17-
git clone --recursive https://github.com/ebith/Switch-Fightstick.git
18-
cd Switch-Fightstick
19-
make
20-
avrdude -pm32u4 -cavr109 -D -P$(ls /dev/tty.usbmodem*) -b57600 -Uflash:w:Joystick.hex # need reset
21+
brew tap osx-cross/avr
22+
brew install avrdude avr-gcc
2123

22-
pip3 install pyserial
23-
./example/rapid-fire-a-button.py /dev/tty.usbserial*
24+
git clone --recursive https://github.com/r-ralph/Switch-Serial-Controller.git
25+
cd Switch-Serial-Controller
26+
cd device
27+
28+
make
29+
avrdude -pm32u4 -cavr109 -D -P$(ls /dev/tty.usbmodem*) -b57600 -Uflash:w:SwitchSerialController.hex # need reset
2430
```

img/screenshot.png

40.7 KB
Loading

0 commit comments

Comments
 (0)