Setup Processing IDE

来自Microduino Wikipedia
Pkj讨论 | 贡献2014年5月13日 (二) 12:54的版本 (Created page with "{{Language | 搭建Processing开发环境}} {| style="width: 800px;" |- | ==Objective== This turorial will teach you how to set up the Processing IDE, and connects to Microdui...")
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索
Language English

Objective

This turorial 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 onebox

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 enviroment, 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.

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