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 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.
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.
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.
- Online course: Processing and Arduino in Tandem
- How to get started with Processing
- Book: Getting started with Arduino
- Parallel programming, Arduino and the good kind of trouble