protolab

 

TutorialProcessingSetup

Page history last edited by Wendy Ju 8 mos ago

Complete these steps BEFORE going on to the tutorial. Email bjoern at stanford.edu if you are having problems with the setup.

 

  1. Install processing on your machine from processing.org/download PC users: get the full version with Java.
  2. Get familiar with the Processing interface by going through the following introductory tutorials (all accessible through File->Examples->Basics). Look through the code and comments, run the sketch, make sure you understand how it works, maybe play with it and change its behavior.
    1. Structure->SetupDraw
    2. Structure->Loop
    3. Input->Mouse1D
    4. Input->MouseSignals
    5. Input->Constrain
    6. GUI->Button
  3. Install the FTDI USB Serial driver for the USB chip on the Arduino board so that your computer will recognize the Arduino when you hook it up to your computer: Windows executable, OS X >=10.4 on Intel Macs, OS X, Power PC or older Intels
  4. Download the Arduino library for Processing from our site (this version is NOT identical with the official version distributed on the Arduino site): arduino.zip. Inside you will find a folder called "arduino" that you should install into the libraries folder in your Processing sketchbook directory. (If you do not already have a libraries folder, you should create one and put the arduino directory into it).
  5. After extracting the library files, start processing and run this test to verify that the library is installed correctly. Processing code (test_arduino.zip):
    /*
    * Test Arduino library
    */
    import processing.serial.*;
    import cc.arduino.*;
    Arduino arduino;
    void setup() {
    size(200, 200);
    noLoop();
    println(Arduino.list());
    }
    void draw() {
    }
    
    The output in the console window below the source code should be something like this ON A PC:
    Stable Library
    =========================================
    Native lib Version = RXTX-2.1-7
    Java lib Version   = RXTX-2.1-7
    [0] "COM1"
    
    and something like this on a Mac:
    Stable Library
    =========================================
    Native lib Version = RXTX-2.1-7
    Java lib Version   = RXTX-2.1-7
    [0] "/dev/tty.Bluetooth-PDA-Sync"
    [1] "/dev/cu.Bluetooth-PDA-Sync"
    [2] "/dev/tty.Bluetooth-Modem"
    [3] "/dev/cu.Bluetooth-Modem"
    
  6. Download all example code (ArduinoTutorial.zip) and extract the folder into your Processing sketchbook's examples/ directory. If you don't have a folder named examples/, create one.

More info on Processing is available at:

 

Comments (0)

You don't have permission to comment on this page.