From Cycling '74 Wiki
Jump to: navigation, search

In this article, I’m going to describe and explain how I designed a small device based on Arduino using external components to add some specific features to our preferred blue board. I’ll begin by describing the whole digital generative project in which this device is involved. Then I’ll explain and give some details about my own research around it. After that we will check how I wired it, tested the very first prototype and finally tried to debug the whole system. And I will finish by giving some specific advices around the Arduino project management, and how to use Max as part of a large project's plan.

The Project

Videospread is a non-profit organisation based in Marseilles, France. Since 2006, Videospread has been researching and developing the concept of production and circulation of silent video art programs dedicated to screening in public spaces.

Connecting Cities will set up a European infrastructure of Urban Media Facades over four years through a series of Connecting Cities events, workshops, conferences and artists’ programmes like research residencies and mobile urban media labs. These process oriented interventions and public activities constitute the heart of Connecting Cities.

I have been contacted by Céline Jouenne from Videospread to work with her and Pippo Lionni on the digital art piece by this latter.

The project consists of making a digital generative scene of a village in which many people appear, work, sleep, eat, walk, play and finally run into panic and eventually die under a massive bombing attack. People can also survive and as a small light of hope, new people can come to live in this village from the outside too.

Software Frameworks

Reading and writing C/C++ and Java, I had to decide about the best fitting framework to make the software part.

Because I could grab already existing materials from Pippo’s previous works, I decided to code/design this piece using OpenFrameworks and some specific codes around sprite-sheets and sprite animation rendering.

I already coded a lot of small apps for iOS with OpenFrameworks and because I could also use it to communicate easily and efficiently with everything like internet and hardware devices, I chose it. Processing could have been used too, but I chose straight C++ compiled based binaries instead of Java virtual machine code execution here. I’m not raising an efficiency debate here, but it is true that I wanted a real scalable code to be able to improve it and add more modules and I used to prefer C/C++ for this purpose.

OpenFrameworks is really optimized for pieces like that. Indeed, the C++ side of programming provides a nice way to organize objects and I really enjoyed to program and prototype this piece progressively to achieve it a few weeks ago.

Sprite and sprite sheets are very efficient when we need to load a lot of small bits of animation on the screen at the same time and that was my way for that task. This is a technique very used in game development.

I used the ofxSpriteSheetRenderer library as a base, but I had to add several parts to make my life easier. Basically, I’m loading the big sprite sheet on which there are all steps of all my animations, here: each step of movements of characters. On each row, there is a type of action with all frames required to visually render the movement. After having defined some animations with their parameters like speed, direction (normal or reverse mode) and more, the library is able to know how to display this type of animation.


The smallest sprite sheet ever

I built a system of objects (using classes) with methods.

Each pictogram on the screen is an human object’s instance and this underlying instance retain its own data like th position on the screen, the current animation and the current frame of that animation, the next action, etc. I tried to modelize some behaviors according to Pippo Lionni’s ideas. These behaviors involved a lot of random and weird conditions in order to bring the digital piece to life. I had to setup a lot of magic numbers constants to make the piece living exactly as Pippo imagined & defined that. The underlying interactivity has been defined as an important part of the piece. Audience/Visitors have to come, watch the piece, understand there is a device on the floor or on a table, grab it and understand they can save people from bombing attacks.

Choosing a Hardware Platform

Obviously and naturally, I thought about Arduino at first. Some friends talked me about Raspberry Pi (which I already knew) and I especially wanted to write this for you here:

Raspberry Pi is REALLY cool.

But as I suggested to Darwin (Grosse) in my interview: it brings a whole operating system and I didn’t absolutely need this. If it can fit a lot of projects (even if I’m more convinced by architecture with very powerful computers + very simple hardware interface), in our project, the main purpose was just:

  • sending data wirelessly
  • reacting to a fast movement
  • being robust
  • being able to be powered by a battery

If Raspberry Pi could meet these requirements, why would I have chosen a whole operating system to make these tasks? I definitively chose my favorite “LESS is MORE” slogan and bought Arduino boards.

Next: Hardware Design