6.200 Arduino Install Instructions

You are not logged in.

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.

  1. Install Arduino (if you already have it from, e.g., 6.310, you can probably skip this step)

  2. 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.

  3. 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.

  4. Close out of Arduino for now.

  5. 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 or C:\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 original main.35ae02cb.chunk.js file. Use the text editor's search function to find the text U=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.

  6. 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 called cores. 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 of boards.txt
    • Download cores.zip and extract it. Inside are two folders: teensy3 and teensy4, and there are matching folders in the install location noted above. Copy all of the files from teensy3 in the .zip file into the teensy3 folder of your install, then do the same for teensy4. 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.
  7. 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 that arduino-ide folder. Afterward, you can open Arduino from the start menu as normal.