6.200 Arduino Install Instructions
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
Several assignments in 6.200 (both in the lab and as part of the homeworks) will involve using a microcontroller called a Teensy, which we'll program using the Arduino IDE. This page will talk through the process of installing Arduino and using it to flash code to the Teensy. The steps vary a little bit depending on your particular setup (what operating system you're using, etc), but we'll outline them here.
Regardless of your choice of operating system, there are quite a few steps to follow, so please do them carefully and in order. There are also some steps below that aren't strictly necessary for this assignment, but which we'll use later in the semester, so we may as well do those now as well.
-
Install Arduino (if you already have it from, e.g., 6.310, you can probably skip this step)
- Windows: Download and install arduino-ide_2.3.4_Windows_64bit.msi
- Mac (Intel processor): Download and install arduino-ide_2.3.4_macOS_64bit.dmg
- Mac (Apple silicon): Download and install arduino-ide_2.3.4_macOS_arm64.dmg
- GNU/Linux: Download arduino-ide_2.3.4_Linux_64bit.zip and unzip its contents somewhere (remember where you put them!)
-
Add the Teensy boards to Arduino
Open up Arduino, and open the preferences window ("File -> Preferences" from the top menu in Windows or Linux, or "Arduino IDE -> Settings" on MacOS). Find the box labeled "Additional boards manager URLs" and paste the following into that box:
https://www.pjrc.com/teensy/package_teensy_index.json
Then click the "boards manager" icon from the left side (it's one of the little grey icons on the left, hover over them until you find the right one) and search for "Teensy" in the menu that pops up. You should get a result there, and a greenish button that says "Install." Click that button and wait for it to finish.
-
Add the XInput library
Click the "library manager" icon from the left side (it's the little grey thing that looks like a stack of books, just under the board manager one) and search for "XInput". You should see a result pop up called XInput (by David Madison), go ahead and click the associated "Install" button and wait a little bit for that to install.
-
Close out of Arduino for now.
-
Update the serial plotter (only necessary for labs/homeworks using the Serial Plotter)
Find the installation folder for Arduino IDE 2.3.4. It is usually in the following places:
- Windows: It may vary from system to system slightly, but these files might be in
C:\Program Files\Arduino IDE
orC:\Users\<username>\AppData\Local\Programs\Arduino IDE
(where<username>
is replaces with your username). - MacOS: Go to Applications and then ctrl-click (or double-finger-click) on Arduino, then click "Show Package Contents".
- GNU/Linux: This will be wherever you unzipped the Arduino stuff.
In that directory, there should be a subfolder "Resources/app/lib/backend/resources/arduino-serial-plotter-webapp/static/js". Make a copy of the file
main.35ae02cb.chunk.js
(in case something goes wrong), and then use any text editor to open the originalmain.35ae02cb.chunk.js
file. Use the text editor's search function to find the textU=Object(o.useState)(50)
in the file, then change the 50 to 500, save the file, and then quit the editor.On Windows, you may need to right-click the file first, then click Properties, then uncheck the box labeled "Read-only" and click "Apply" before editing the file.
- Windows: It may vary from system to system slightly, but these files might be in
-
Add XInput support for Teensy (only necessary for the Gamepad lab)
Finally, we'll need to modify some of the Teensy files to allow it to work with XInput. You'll need to know where these files are stored on your computer; a search for
boards.txt
might help, but these files are usually in the following spots:- Windows:
C:\Users\YOUR_USERNAME\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.59.0
- Mac:
/Users/YOUR_USERNAME/Library/Arduino15/packages/teensy/hardware/avr/1.59.0
- GNU/Linux:
~/.arduino15/packages/teensy/hardware/avr/1.59.0
Inside of there, you should see a file called
boards.txt
and a folder calledcores
. Make a copy of both of these things in case something goes wrong, and then we'll make a few changes here:- Replace
boards.txt
with this version ofboards.txt
- Download
cores.zip
and extract it. Inside are two folders:teensy3
andteensy4
, and there are matching folders in the install location noted above. Copy all of the files fromteensy3
in the .zip file into theteensy3
folder of your install, then do the same forteensy4
. If you are presented with an option, make sure to choose the one that overwrites existing files.- If you later get an error message referencing
Arduino.h
when trying to program the Teensy, this is likely the step that went wrong. If that happens to you, you can fix it by uninstalling and then reinstalling Teensy from the boards menu, and then trying again to overwrite those files without deleting any other files.
- If you later get an error message referencing
- Windows:
-
Clear Arduino's Cache (Windows Only)
Before re-opening Arduino, look for a folder on your hard drive called
C:\Users\<username>\AppData\Roaming\arduino-ide
. Delete thatarduino-ide
folder. Afterward, you can open Arduino from the start menu as normal.