Skip to content

Latest commit

 

History

History
303 lines (168 loc) · 13.1 KB

GettingStartedGuide.md

File metadata and controls

303 lines (168 loc) · 13.1 KB

🦾 Getting Started Guide

日本語

💻 System Requirements

  • Google Chrome (Windows / macOS / Linux)
    • Smartphones and tablets are not supported (Android may work, but we have not tested it)
  • Nintendo Switch (v13.0)

📦 Required devices

The following devices are required.

  • Microcontroller with Atmega32u4
  • Serial communication module (FT232 or CC2640R2F)
  • Jumper wire (male-to-female)

💿 Writing a program to a microcontroller

Since no program has been written to the microcontroller in the industrial shipment state, you need to write a program using Arduino IDE.

First, install the Arduino IDE from the official website.

https://www.arduino.cc/en/software

Install Arduino IDE

selectOS

Download the version that matches your OS.

download

For macOS, move it to the Applications folder.

app

When you launch the application, you will see a screen like this.

launch

Download the program

Next, download the program to write to the Arduino Leonardo.
Go to Repository and click on Download Zip.

code

Open the configuration window of Arduino IDE.

performance

In this screen, you can see the location of your Arduino sketchbooks.

path

Navigate to there in Finder or Explorer. In most cases, the path will be as follows.

macOS: /Users/Documents/{YourUserName}/Arduino.
Windows: C:\Users\{YourUserName}\Documents\Arduino\

arduinofolder

Unzip the zip file you just downloaded and move it into the Arduino folder marked as Sketchbook Location.
If you already have a Libraries folder, just move the contents into it.

move

When you are done here, close Arduino IDE.

Write configuration

You are now ready to write the program to the Arduino. The next step is to configure the board settings for the Arduino.

If you use the Arduino's ID as is, NintendoSwitch will not recognize the Arduino as a controller. If you rewrite the ID assigned to the Arduino to the same ID as Pokken DX Pro Pad, NintendoSwitch will recognize the Arduino as a controller.

The procedure for rewriting the ID is as follows.

⚠️ Please make sure that Arduino IDE is closed.

macOS

Right-click on Arduino in the Applications folder and select View Package Contents.

arduino

Open the file boards.txt in the following folder with a text editor. /Contents/Java/hardware/arduino/avr/.

boardspath

Windows

Open the file boards.txt in the following folder with a text editor.
C:\Users\<YourUserName>\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.13

⚠️1.8.13 part is the version of Arduino IDE you installed.

Edit boards.txt (macOS / Windows)

Rewrite the following 4 values and save the file.
Be careful not to change the wrong part.

Row Key Before After
285 leonardo.vid.1 0x2341 => 0x0f0d
286 leonardo.pid.1 0x8036 => 0x0092
311 leonardo.build.vid 0x2341 => 0x0f0d
312 leonardo.build.pid 0x8036 => 0x0092

boards.txt

⚠️ Don't forget to save the file after editing.

Write the program

Now that everything is ready, let's write a program to the Arduino.
Connect the Arduino to the PC via USB. If the connection is successful, the LED will light up.

arduino

Go back to the Arduino folder where you just moved the files.
Open the contents of FT232 if the serial communication module you got is FT232 (wired module), or CC2640R2F if it is CC2640R2F (wireless module).

folder

file

Open Tools -> Boards and select Arduino Leonardo.

baord

Open Tools -> Serial Ports and select the one that contains the string usb.
In most cases, there will only be one port that contains usb, but if there are multiple ports, select them from the top and try until the following process is successful.

port

Click the check button in the upper left corner to compile the program.
It is OK when the message "Compilation completed" appears at the bottom of the screen.

compile

Finally, click on the arrow button to write the sketch.
If you see "Writing to the board is complete" at the bottom of the screen, you are finally finished.
Congratulations!

Screenshot 2021-10-11 23 32 54

🔌 Connecting the device

FT232 (wired module)

Use a jumper wire to connect the Arduino to the FT232.
Stick the wire so that the RX and TX pins intersect.

Arduino FT232
TX1 <=> RX
RX1 <=> TX

It's small and hard to see, but the names are written near the pins.

ft232

You can use any color of jumper wire you like.

rxtx

Connect the Arduino to the Switch's dock.

arduino-switch

Connect the FT232 to the PC.

ft232-pc

Finally, make sure the whole thing is connected as shown below.

sketch

CC2640R2F (wireless module)

Arduino CC2640R2F
TX1 <=> RX
RX1 <=> TX
5V <=> VCC
GND <=> GND

There is no need to connect anything to the PC side.

🌎 Google Chrome Settings

In order for GoogleChrome to communicate with Arduino, you need to enable the settings.
Type the following into the address bar one by one and set all of them to Enabled.

chrome://flags/#enable-javascript-harmony
chrome://flags/#enable-experimental-web-platform-features

When using CC2640R2F (wireless module), the following items should also be set to Enabled.
chrome://flags/#enable-web-bluetooth-new-permissions-backend

chrome

🪟 WindowsOS Driver Settings
It seems that Chrome WebUSB API does not allow WindowsOS users to use WebUSB for devices for which the system driver is provided by the OS.

In Windows 10, was able to solve this problem by the following settings.

  • Install Zadig.
  • Do Replace Driver with the following settings
    windows

🎉 You are now ready!

Here are the instructions for using PhantomHand.
First, please visit the site.

https://phantom-hand.web.app/

Click on the purple button.

home

Select the game software that you want to control with PhantomHand.
If you don't have one, just choose one.
(If you have any additional requests for game software, please send me a message.)

projects

When you see the controller screen, click the USB icon in the upper left corner and select Search Device.
If you are using the CC2640R2F (wireless module), click the Bluetooth icon.

search

When the pop-up window appears, select the device and click Connect.

connect

Once this is done, you should be able to control Switch from your browser.
Operate the GUI controller and see if Switch screen responds!

demo

If it doesn't work, try pressing the reset button on the Arduino.
The LED will start blinking and it will reboot in 5~10 seconds.

If it still doesn't work, there is most likely a problem with the connections.
Check all the connections.
(It is very common to misconnect the RX and TX pins)

reset

📖 How to use

If you've made it this far, you probably don't need me to explain, but just in case, here's a brief explanation.

gui

Side menu

Allows you to select preset commands. The most frequently used commands in the game are saved in the side menu.
Currently, only the developer can edit the side menu. If you have a command you would like to save, you can share it on Twitter and it may be noticed by the developers.

Gamepad

The gamepad displayed in the center of the screen can be operated by clicking and dragging. If the device is connected, the operation will be reflected on the Switch.
If you have a PC with a pro-controller connected, the buttons on this gamepad will light up when you move it.

create

Macro

The control buttons in the upper right corner allow you to Create, Play, Repeat, and Share macro commands.

Share

The ability to save created commands is currently not available to the public, but you can share commands via URL instead.
When you press the share button, a URL will be issued.
By accessing the URL, everyone can replay your command with a single click at any time.

share

✅ Conclusion

If you see any improvements, please send me a pull request! 🥺