Setup Processing IDE

From Microduino Wiki
Revision as of 08:59, 13 September 2016 by Fengfeng (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Language: English  • 中文

Objective

This tutorial will teach you how to set up the Processing IDE, and connects to Microduino to show processing's powerful graphics and interaction function.

Equipment

  • Other equipment
    • USB cable one
    • LED one
    • 330Ω resistor one
    • Bread one
    • Breadboard Jumper one box

Processing

Processing is an open source programming language and integrated development environment (IDE) built for the electronic arts, new media art, and visual design communities with the purpose of teaching the fundamentals of computer programming in a visual context, and to serve as the foundation for electronic sketchbooks. The project was initiated in 2001 by Casey Reas and Benjamin Fry, both formerly of the Aesthetics and Computation Group at the MIT Media Lab. One of the stated aims of Processing is to act as a tool to get non-programmers started with programming, through the instant gratification of visual feedback. The language builds on the Java language, but uses a simplified syntax and graphics programming model. Official webpage: http://www.processing.org


Schematic

ProcessingControlLED原理图.jpg

Program

https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/setupProcessingDevEnv

Debug

Before setup the Processing development environment, you need install JAVA JDK firstly. You can download the JDK package from orical webpage.

Step 1: Download Processing from official webpage. Put the folder to anywhere you want. https://www.processing.org/download/

Open the folder you can see following contents:

ProcessingFlode.jpg

Download the Processing's Arduino library which used to communicate with Arduino. Open the link "http://playground.arduino.cc/Interfacing/Processing", you can see following prompt:

DownArduinoLib.jpg

Click download, and uncompress the Arduino folder, then copy to modes\java\libraries folder of Processing, restart Processing IDE.

Click the processing.exe to open the Processing window, as follows:

ProcessingDEV.jpg

It is very similar with Arduino IDE.


Step 2: If you want to set up the connection between Processing and Microduino, need choose serial and Arduino(Firmata) function in Sketch-->Import Library. After selected, they are added in IDE automatically, just like the yellow part in following picture.

ProcessingImport.jpg

Serial used to monitor serial data.

Arduino(Firmata) uses to control Microduino.

Open the Arduino IDE, download the "Examples > Firmata > StandardFirmata sketch" program to the Microduino core, as follows:

Firmata.jpg

Select the Microduino core module, then download directly, then Processing can communicate with Microduino.

Step 3: Explain the code:

//default define first com port arduino = new Arduino(this, Arduino.list()[0], 57600); //set LED pin is output arduino.pinMode(ledPin, Arduino.OUTPUT);

//digitalWrite hight to ledpin arduino.digitalWrite(ledPin, Arduino.HIGH);

Set the baud rate to 57600. You need set the same baud rate in Processig and Microduino.

Step 4: Set up hardware system, as follows:

ProcessingControlLED连接图.jpg


Step 5: Compile the program and download it.

Result

The light will flash with 1s time interval, just like use the Arduino to control.

Video