This section will walk you through the entire process of setting up your microcontroller on a Mac computer.
For Linux, you will need to find on your own the apt-get
commands corresponding to the macOS package installation commands listed below.
But since you are using Linux, I would assume you are computer-savy and know how to do this!
At this time, the HexGenerator program used for micro-controller programs on Windows is not yet available for Mac or Linux. You will need to run and debug a script that is no longer supported by us to generate it.
Make sure you have one of the hardware:
- Hardware - Arduino Leonardo
- Hardware - Teensy 2.0 and Teensy++ 2.0
- Hardware - Pro Micro
- Hardware - Arduino Uno R3
- Install homebrew: https://brew.sh/
- Install AVR:
- Run
brew tap osx-cross/avr
. - Run
brew install avr-gcc
. - Run
brew install avrdude
.
- Run
- Install fzf:
brew install fzf
Download the latest version of our Arduino programs from here.
(The link should look like something like PASwShNativePrograms-yyyymmdd.zip
)
If you get a virus or malware warning, ignore it. These are known false positives. If you don't trust us, the source code is in this repo.
Once you have downloaded the package, unzip to somewhere you can access later.
This step isn't needed for the TurboA example here, but is for nearly every other program.
- Navigate into the
NativePrograms/NintendoSwitch
folder. - Open
TurboA
with a text editor.
We recommend starting with "Turbo A" as it is the simplest program. If you are able to get this running, it is easier to troubleshoot the other programs.
Normally you will see a bunch of options that can configured. But TurboA has nothing.
- After you have made your changes, save the file.
See the documentation for the respective program for a description of all the options.
Choose the instructions based on the microcontroller you have:
- Open Terminal.
- Type
bash
(with a trailing space!) Do not hit enter after entering this. - Drag from finder the "00-FlashUnix.sh" script in
NativePrograms/NintendoSwitch
folder into the Terminal Window. - Press enter.
Once you run the script, it will prompt you for:
- The board type. Enter
ArduinoUnoR3
ArduinoLeonardo
ProMicro
depending on your board. - Which program to compile and load. For this tutorial, enter
TurboA
.
It will automatically build the program and flash it to your device.
- Download Teensy Loader if you don't have it yet.
Direct download link: https://www.pjrc.com/teensy/teensy.dmg
- Open Terminal.
- Type
bash
(with a trailing space!) Do not hit enter after entering this. - Drag from finder the "00-BuildAllUnix.sh" script in
NativePrograms/NintendoSwitch
folder into the Terminal Window. - Press enter.
This will build every single program in the package. As of this writing, there is no easy method to build that is more targeted. If you are confortable with makefiles and command lines, you can directly use the makefile.
- Run the Teensy Loader program that you downloaded earlier.
- Click the purple file icon and browse for the .hex that was created in the previous step.
- Plug the Teensy into your computer.
- Press the white button on the Teensy. You may need to wait for Windows to install drivers.
At this point, two green arrows should show up in Teensy Loader.
- Click the left arrow. This flashes the program into the Teensy.
- Unplug the Teensy from your computer.
- On your Switch, enter the game and navigate to somewhere you want to mash A in front of (such as the digging duo in Sword/Shield).
- Navigate to the grip menu without closing the game. This disconnects all controllers from the Switch so that the microcontroller can take over.
- Plug the microcontroller into your Switch (or the dock that's attached to it).
The program should now begin running. It will flash its light for a few seconds, then it will connect to the Switch and navigate its way back into the game. After a brief pause, it will start mashing A.
Usage Notes:
- To stop the program, simply unplug the microcontroller at any time.
- Do not change video output or mess with the HDMI. These can cause the program to Switch to freeze for multiple seconds and break the program. If you want turn off the TV, do it before you start the program.
You now know how to run TurboA - the most basic of the microcontroller-only programs.
You can choose any of the other microcontroller-only programs stored in NativePrograms
folder and repeat steps 4-6.
It is important to read the manual for a program before you use it. Each program has a different set of instructions and startup conditions.
Now that you are done with the Microncontroller tutorial, you can proceed to the Computer-Control tutorial.
Discord Server: