Jump to content

What you can do with Processing and Arduino

+ 3
  macslocum's Photo
Posted Aug 04 2010 04:46 AM

Building a creation that translates software signals into physical movement brings with it a unique satisfaction. Joseph Gray has tapped into that satisfaction himself through art installations and visual performances.

Gray will be teaching an upcoming O'Reilly course on Processing and Arduino, the aim of which is to allow anyone -- programmers and artists alike -- to create digital art tools with low-cost materials. He provides an overview of Processing, Arduino and the "hardware hacking" mindset in the following Q&A.

If I have Processing and I've got an Arduino board, what can I do?

Joseph GrayJoseph Gray: The answer is: almost anything. More precisely, you can write a near infinite variety of software applications with Processing and build electronics projects with an Arduino. The two combined provides an easy way for the software you write to talk to the outside world, and vice-versa. A basic example would be to use the Arduino with sensors hooked up to it to read temperature, then send data to software on a computer to display the temperature information. Data could go the other way, too. A user could use a mouse to control motors connected to the Arduino.

Does Processing have a learning curve?

Processing provides a straight-forward entrance to coding for people new to writing code, particularly those who are visual thinkers. You can preview what your code is doing at anytime just by clicking a "play" button. The language is also similar to a huge variety of other, more robust coding systems. If you become familiar with Processing, other code you might come across will be a lot more readable.

Seasoned programmers will also enjoy Processing, and for the same reasons that beginners do: because you can quickly sketch up ideas and see them working right away. The Processing language is built on Java, but it's also been ported to other environments like the recently-released Field development environment and a Javascript-native version called Processing.js.

Processing may not be the best end solution from an enterprise perspective, but it's still useful for rapidly developing ideas before solidifying in another language.

What do you need to get started with Arduino?

The first thing you need is the Arduino board itself and the software that goes with it. The board is relatively low-cost (usually in the $35 range) and the software is free, and the source code is open-sourced. The Arduino schematics are freely available, so it is also possible to build your own Arduino from parts, and people do. For the most part though, the off-the-shelf Arduino is more than sufficient.

Beyond that, a basic electronics toolkit is really useful. The Arduino board is designed to plug in standard electronics components using jumper leads (wires between the components and the board), so things like wire-strippers/cutters and a soldering iron are helpful. The types of components you might use with it, particularly when beginning, are potentiometers (a.k.a. variable resistors) and switches for input, and small motors, LEDs and speakers for output.

How do Processing and Arduino interact?

The Arduino Duemilanove (and its predecessors) have a mini-USB port on them that provides a connection directly to the computer. The USB port is actually a serial port, so serial communications to and from the Arduino can be achieved with any serial library.

Processing has such a library included natively, so custom software can be written to get into the Arduino directly from the desktop or laptop. The most convenient solution, and one that works for many applications, is to use the Firmata software loaded onto the Arduino and then use the Arduino library for Processing. The great thing about using these in combination is that the serial communications protocol is set up for you, giving direct access to the electronic inputs and outputs of the Arduino board all from within the Processing code. Within the Processing software, an Arduino with Firmata installed appears as an object whose properties are immediately available for use with just a few lines of code.

Processing and Arduino

You're teaching a class on Processing and Arduino. What will students be able to create once they've completed the course?

The course will focus on basic versions of tools that I use in my artistic practice. The goal is to provide participants with something useful they can modify later and expand for their own purposes.

The first software project in the course will be to create a fully-functioning drawing tool that can save images. That software will then be modified to become real-time animation software, essentially a visual synth that can be used for live performances or for creating abstract visuals to be edited into another project.

The last half of the course will focus on using the Arduino to create a custom physical interface that can be used to control the visual synth software. These are useful digital art tools that not only provide an entryway into software and hardware hacking, but also give some ideas of what the technologies can be used for.

Is there a difference between a software hacker and a hardware hacker?

Software and hardware have always gone hand-in-hand. There's quite a bit of crossover between the two disciplines, as micro-controller-based systems, such as the Arduino, use a software interface to give them their instructions. The only difference between the mindsets is that hardware hacking is obviously more "hands on" while software is a step removed from the physical.

This interview was condensed and edited.

Joseph Gray will teach the free, five-week online course "Processing and Arduino in Tandem." Sessions begin Aug. 31 and run to Sept. 28. More information is available on the course page.


3 Subscribe

2 Replies

  beth_freeman's Photo
Posted Jan 28 2011 05:48 PM

Joe is teaching two more classes in this popular series, one on building a video mixer and one one building an Audio Visualizer. They are going to be a lot of fun!

If you're interested in attending the live classes (they're free), register here: http://training.orei...o-audio-visual/

If you miss them, we'll be selling the videos! http://search.oreill...duino+in+tandem

Hope you can join us.

Attached Image

Attached Image
  explorer.ARD's Photo
Posted Jan 22 2013 06:58 AM

Hi! I'm a high school student here in the Philippines. and I need great help from you, the experts, for our Science Investigatory Project for short S.I.P. Our study is in line with physical sciences.

I just want to ask 1 question. If I had an Arduino board wherein a 2.8" TFT Touchscreen is connected using a breadboard, and I was to draw something on the touchscreen, can the Arduino interpret the signal it got from the touchscreen to make the computer be able to "read" what was written on the touchscreen?

Your help is greatly appreciated...