December 23, 2009

Slit Scan Box model

Art Box.jpg

This is the model of my slit scan box. Inside I had installed an i-cam to capture the footage as the people moved a wooden block with a cloth pattern on the bottom, over the surface of the clear plexiglas surface. An LED light was also installed inside in order to make the image of the pattern clear within the enclosed space of the plexiglas surface.

-Mike Ballard

Thumbnail image for fabric3.jpg

December 22, 2009

Independent Project: Mother Me?

One-on-One Sketch-crop8xAdjs.jpg

Sketch reflects initial design for belt

This project is a prototype interactive wearable belt. It has been designed with two focuses in mind. On the one hand, it "heralds" a future in which cloning and "petri-dish pregnancies" are a norm. A woman may choose to carry her fetus to full-term in a wearable incubator (re-sized to match the growth of the fetus). In this senario, the woman's partner may also share in the carriyng-to-full-term.

The second focus relates to women's experiences of strangers giving themselves permission to touch their pregnant stomach. It has two modes of operation: non-touch and touch. In non-touch mode, a red "warning" lights flashes in the capsule with a modeled fetus to discourage touching. In touch mode, a series of interactions are possible. The cast rubber part has two touch zones. Touching the container with the fetus embryo model, triggers a white LED in the fetus to pulse. Depending how the cast rubber part of the piece is touched, different sequences of blue LEDs blink or pulse.


Wearable not activated.


Wearable in Don't-Touch mode


Wearable in Touch mode

The following code reflects the second focus operations. Note: Commented out is code for using a Rogue Robotics sound shield to play sound clips together with the LED lights. The interface is not working at this time.


Other Related Projects - Alec Rippberger


This piece of artwork blinks as if it were alive and beating! The closer you approach the faster the heart "beats". I used several LEDs attached to 1k resistors embedded in the semi transparent sculpture of a "heart". These LEDs ran into the digital pins of the arduino and were controlled by the following code:

/* Ping))) Sensor

This sketch reads a PING))) ultrasonic rangefinder and returns the
distance to the closest object in range. To do this, it sends a pulse
to the sensor to initiate a reading, then listens for a pulse
to return. The length of the returning pulse is proportional to
the distance of the object from the sensor.

The circuit:
* +V connection of the PING))) attached to +5V
* GND connection of the PING))) attached to ground
* SIG connection of the PING))) attached to digital pin 7

created 3 Nov 2008
by David A. Mellis
modified 30 Jun 2009
by Tom Igoe
// this constant won't change. It's the pin number
// of the sensor's output:
const int pingPin = 7;
//variables for digital pins one through five used as LEDs
int pinSix = 6;
int pinTwo = 2;
int pinThree = 3;
int pinFour = 4;
int pinFive = 5;

void setup() {
// initialize serial communication
// set pinmode for LEDs
pinMode(pinSix, OUTPUT);
pinMode(pinTwo, OUTPUT);
pinMode(pinThree, OUTPUT);
pinMode(pinFour, OUTPUT);
pinMode(pinFive, OUTPUT);

void loop()
int beat = 1000;
int unbeat = 2000;
int rest = 3000;
// establish variables for duration of the ping,
// and the distance result in inches and centimeters:
long duration, inches, cm;
// The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
digitalWrite(pingPin, HIGH);
digitalWrite(pingPin, LOW);
// The same pin is used to read the signal from the PING))): a HIGH
// pulse whose duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);
// convert the time into a distance
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
Serial.print("in, ");

beat = inches * 6;
unbeat = inches * 5.5;
rest = inches * 18;

digitalWrite(pinSix, HIGH);
digitalWrite(pinTwo, HIGH);
digitalWrite(pinThree, HIGH);
digitalWrite(pinFour, HIGH);
digitalWrite(pinFive, HIGH);
digitalWrite(pinSix, LOW);
digitalWrite(pinTwo, LOW);
digitalWrite(pinThree, LOW);
digitalWrite(pinFour, LOW);
digitalWrite(pinFive, LOW);
digitalWrite(pinSix, HIGH);
digitalWrite(pinTwo, HIGH);
digitalWrite(pinThree, HIGH);
digitalWrite(pinFour, HIGH);
digitalWrite(pinFive, HIGH);
digitalWrite(pinSix, LOW);
digitalWrite(pinTwo, LOW);
digitalWrite(pinThree, LOW);
digitalWrite(pinFour, LOW);
digitalWrite(pinFive, LOW);

long microsecondsToInches(long microseconds)
// According to Parallax's datasheet for the PING))), there are
// 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
// second). This gives the distance travelled by the ping, outbound
// and return, so we divide by 2 to get the distance of the obstacle.
// See:
return microseconds / 74 / 2;
long microsecondsToCentimeters(long microseconds)
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;

Over the course of the semester I have worked on several projects that relate to the themes of this course. One project was the creation of a friends website. The project is made 100% percent from scratch, using images and design created and manipulated by me using the Adobe CS4 Suite. The website has several interactive components:
  • The popup windows when hovering the mouse over links
  • The custom made flash music player

I feel that the creation of this site has helped me better understand some of the concepts covered in Making Art Interactive while also expanding my definition of creative interactivity.

Another project that I have undertaken recently is the creation of a flash photo slideshow for my girlfriend' blog. I used Abode Flash CS4 and ActionScript to create a custom slideshow that fits in with the theme of the blog. AdrianesTravels.swf

Interactive Wall

This project uses capacitive sensors to communicate with Processing via the Arduino. I am currently in the process of re-writing the code to work out bugs and such. The wall will be on display in the Rapson Hall courtyard over break and during the first week of the Sping 2010 semester.

Justin Berken

My Slit Scan Project (Final)

When Diane showed me the slit scan program in processing, I almost immediately knew what I was going to do. Taking a little bit of my inspiration Maurice Benayouns identity stealing worms, I wanted to create a structure that could take the interaction of the subject and project it for them to see and change in real time.

I think my idea for making the boxes as the source for one to interact with was that the box as an object is something simple and universally recognized as being something a person is not really afraid to interact with. The construction of the boxes was key to realizing my project and it became quite frustrating in the end when I found my self being held up by their construction. I eventually decided that I would have to build them myself, something I knew I was not proficient in doing, but must be done in order to get there. I had a solid plan that I was sure would work, but with out the boxes complete, I had no way to test it and make sure.

The plan itself was to have three boxes which had openings at the top where individuals could put and move around blocks with fabric patterns on the bottom side. Camera's inside the box would capture the footage and run it through the slit scan program which would take these patterns and their movements and elongate them through time. These images would be projected on the wall for the individuals to see and react with. Lights would also have to be placed inside the box pointing up at the patterns in order for the fabric to be seen by the camera.

A complication arose when I realized I would have to use 3 separate computers to run the slit scan because I did not want them to be part of the presentation. The solution came when I found a white display box that I could stash the computers in as well as set my main display up on top of the box. The boxes themselves were obviously not constructed with the most talented of hands so I used lighting to hide or distract from their defects. As it turned out, once the boxes were completed and I had found a way to install the lights and cameras, the plan had worked out pretty much exactly the way I had envisioned, which doesn't usually happen. I think this had to do a lot with the experience I had in the previous group project, where I learned a sort of method of work which was to start out simple and keep building on that concept. In the end I believe I had a successful project.

The main concept of the presentation from the start was to evolve around the idea of identity, time, and choice. The people interacting with the project have many patterns (identities) to choose from and each one they will effect in their own way. They make their decision and they use the boxes to form (recycle) that pattern the way they wish. As they do, their patterns are mixing with the patterns of those around them and each pattern is connected to one another. These patterns are all effected and tied together by the passage of time.

Most of my other documentation for this project has been lost to the trash can (sketches, blueprints, etc.

Midi Controller

My final project was my first attempt at creating something useful and perhaps artistic on its own accord. The process of construction was a difficult one because as I worked I attempted to give everything a semi-professional appearance. Earlier I had conceptualized a sort of wheel midi controller, however I decided to start somewhere that I knew I could complete given my understanding of arduino and its respective software. I have learned a lot about "depunking" the arduino through the course of this project. The excitement of compiling a program without an array of confusing error messages is incomparable to any enjoyment in life. There are a lot of little tips and tricks that should be published in a special "depunking" the arduino website.

Now I am comfortable enough with arduino that I can make the arduino bend to my will, and due to its processing origins I believe that some processing work might be in order for me as well. This whole project probably learned me a lot.

Back to Midi controller

I first experimented with methods of scaling potentiometer inputs however they follow an interesting curve of scaled values, and every pot. seemed a little bit different. Also when I was experimenting I found that the values seemed to fluctuate considerably, then I developed a method of recognizing a (deliberate) change in values but this too would have to be scaled, Interesting note I put this code aside when I built the 16 pot array and when I used digital outputs power the pots The fluctuations declined considerably. This is when I'm not sure whethe to be happy that it works better or to call the arduino a punk for wasting my time earlier.

Midi interfacing
Midi interfacing is extremely easy - download the midi library from arduino website, There is a midi arduino, but for just a simple midi output, its not completely neccessary.
I like midi communication because this is not limited to computers like the serial communication is. Also it seems more practical in the creation of music whether it be ambient installation, or more directed music.

Look at the diagram and know that what I'm telling you is true:

The Controller itself was very interesting, I had coded and developed a Led digit display that was going to display the note for each pot. However I didn't get the chance to combine the codes in some holy matrimony? Also the device was clearly reacting to input, but it seemed to provided its own interpretation of this input.

The result: some weird sounds.Image025.jpg
pictures of the device^^^

code of the pot block
this one is code for my various experiments with pots and led display

the file below is an audio file of me using the block to make drums and a synth sound recording on reason.
pot block.mp3

My arduino guide

My arduino guide
(or how I learned to stop worrying and love the atomic bomb(arduino))
As you all may know the arduino is a punk and punks cannot be tolerated in the new media realm so here are some tips to depunk your sh-t:

1.Do not use digital ports 1 or 2 (unless you have to) because they can screw up your serial connection. They are the arduino serial communication ports by default. (good for midi)

2. I feel stupid when i do this and so that you too don't have to feel that feeling remember "=" will store a value, or change a variable. "==" is used for comparing values

3.When you add a library to your library I found that it wont work (punk) unless it is in a folder by the same name. If the folder does not exist, I guess you have to make it. I believe that this, in conjunction with arduino being a punk, accounts for 89% of "include" errors.

4.Those punk digital outputs leak. If digital write is == LOW it grounds. use diodes to stop the leaks.


remember the semicolon ";"all hail the holy semicolon.
and "these" {}{}{{{{{}}}}}} check your "these"

6. although the arduino operates on 5v the digital output on these babies is 3.3 not strong enough to flip a 6v relay, like a good boy. However juice it up using 3 digital outputs more amps and then your relays are gonna go WEEEEEEEEEEEEE

7. I learned a lot about soldering and there are some keys, use the wet sponge to get the iron "sticky", pick up a blob and get it nice and shiny. Then do not use wire that's hard to bend, the bendier the easier it is to solder, and the better chance it will work correctly. Remember the heat shrink tubing

8. int (yourvariablehere) = blahblahblah
this value is weak and cannot be negative and cannot hold decimals like a punk.
I wasted a lot of time staring at the program questioning why the world hated me. Then i began to float

:float (yourvariables) and you don't have to go crazy and float everything but when your stuck.

9. Remember that arduino is a punk and punks need love sometimes too.

Translucence and Shadows

For my independent project, I wanted to use the qualities of light and shadow and explore the properties of some translucent, Duralar material. A servo sweep operates and animates a scene composed of film strips and a plastic model tree. Multiple light sources create layers of shadows, with one layer splitting off into three and then reverting.

In this revised version of the project, a plain full screen was used, which was constructed out of a large sheet of Duralar, 3 dowel rods and some leftover presentation board pieces for support and to create a frame.




Analogue Image Project

In the other project that I experimented with, two wheels were set up parallel to one another. One had photographs with holes in their centers. The other was a mini-installation of found material with light coming from behind. A video camera captured only the size of the photographs and projected the constructed worlds onto the wall. Does this make sense??



Interactive Tree

I was happy to finally get all the components I needed to make a video interactive. I used a sensor and a bit whacker and connected them to a max patch that took input from the sensor and could convert it to numbers that then changed the opacity of the video (I had two videos layered on top of one another). It could also do things like change the exposure or speed of the video. Pretty cool. Andy Mattern showed me how to use the patch. It looks like this:

maxpatch image.jpg

Here's the actual file:

bitwacker input test.pat

I used a sparkfun bitwacker (bit whacker) as my microcontroller instead of our usual arduino because I guess it speaks to max/msp better. Here's a link to how to set up the bit whacker.

With a new distance sensor (because the ultrasonic sensor I bought required an input pulse to be programmed into it from the microcontroller, and by the time I figured that out I didn't have time to learn a new language to program a new microcontroller). In the presentation of the piece the projected video changed as people walked up to it. The tree went from being a plain tree to having gold shine through it.

December 21, 2009

Prelude to Fly on the Wall Project

For continuing with my idea, as I mentioned in class, once I figure out the proper coding I would like to do a little miniseries using the same interaction (scrolling flash using a potentiometer) with different themes. Themes involving small animals with different perspectives would be interesting. For example, with this project I used an insect that had a very low perspective, so using an animal like a bird or something that would be higher up would be cool. Or an animation of something underground, so you would see a worm's perspective or something, I think you get the idea. For the visuals, I would have preferred to have an actual drawn animation, not video format, because animation was originally why I was interested in using arduino with flash. I also think the aesthetic of animation would help realize the piece more for someone who is interacting with the potentiometer handle feel and how that relates to what they look at. Live video seemed to have a disconnect a bit from what i intended, but I think a fabricated reality would be a nice touch to the action of the piece. Then, in terms of how someone interacts with the piece, I've always thought of this as being a little mini series on a website or something like that, where you would interact with it just as how I presented it on my laptop in class. But when thinking about other options for viewing this, I think it would be really interesting to have it be large scale as well. Where the image would be projected against a wall and the entire framing of the wall would be covered. Then if it was in a rectangular or box-like room, when you moved the potentiometer the entire screen projection would move to different areas in the room. So it would take up an entire blank room. For example, when looking forward you would see the entire projection against the wall in front of you and if you scrolled right, then the projection would scroll against the wall over to the wall on your right. In this scenario, the tiny little potentiometer would seem very powerful because a tiny little object/fly/bird/bug/whatever would control the motion of this huge projection in the room. Those are my hopes and dreams for this project anyway, once I figure out step number 3 that is! But if anyone has any thoughts on this, I'd love to hear them.

Final Project

Photo 33.jpg

View image

Here is my coding, painting.pde..

int photocellPin = 0; // the cell and 10K pulldown are connected to a0
int photocellReading; // the analog reading from the sensor divider
int LEDpin = 11; // connect Red LED to pin 11 (PWM pin)
int LEDbrightness; //
void setup(void) {
// We'll send debugging information via the Serial monitor

void loop(void) {
photocellReading = analogRead(photocellPin);

Serial.print("Analog reading = ");
Serial.println(photocellReading); // the raw analog reading

// LED gets brighter the darker it is at the sensor
// that means we have to -invert- the reading from 0-1023 back to 1023-0
photocellReading = 355 - photocellReading;
//now we have to map 0-1023 to 0-255 since thats the range analogWrite uses
LEDbrightness = map(photocellReading, 0, 355, 0, 50);
analogWrite(LEDpin, LEDbrightness);


For my project I created an interactive painting. I inserted a light sensor in the painting that would cause several blue LED lights to light up when there was a lack of light hitting the sensor. I imagined that the painting set up in an area with natural light and would change throughout the day as the light slowly turned to darkness causing the painting to glow bright blue. If i were to make another one of these paintings i would have painted the paintings with the LEDs on so that i could better play off of the light and i could match the colors better. I also wish that i could have gotten my original idea to work so that i could have programmed the LEDs to switch from one to the other based on the light sensor.

FINAL Blinky Glove - Bryce Davidson

It was quite a journey with the Lilypad Arduino, but it worked out in the end. I really learned a lot. I was happy to have learned how to use conductive thread, program pins, work with powering the Lilypad, and physical construction. Here is the pictorial/video history of my project's progress...


and the Code

int ledPin = 10; // LED connected to digital pin 13

// The setup() method runs once, when the sketch starts

void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);

// the loop() method runs over and over again,
// as long as the Arduino has power

void loop()
digitalWrite(ledPin, HIGH); // set the LED on
delay(80); // wait for a second
digitalWrite(ledPin, LOW); // set the LED off
delay(80); // wait for a second

I am still waiting on the download of the video footage of my performance with the blinky Lilypad glove, but for now, I think it really worked out how I wanted it too. I had hoped to understand the button switch, but I was still able to accomplish what I wanted to with my project which was an interaction between the digital world and the physical world. This is what I really understood Interactive art to be in its essence.

To break down the concept of my performance, I started with the idea of seeing light interact with movement. I wanted to make a complete body suit full of lights and then do a dance performance in it. My first thought was to power this suit with an accelerometer, so that the amount of light was dependant on the amount of movement. I came to realize that my understanding of the arduino and all of its elements would have to grow quite a bit more to realize this idea. But it was for the best when I started to think about the CONTEXT of this idea. Why was I spinning around with lights on my body? Why was I breakdancing? What was this idea about? As I explored this idea, I came to the realization that I wanted to create a story. I wanted to display something that had a pace. A piece that had a beginning, middle and end. I also liked the idea of opposites and extremes. Through this exploration of context and story line, I decided on creating a piece that had an interaction between an animated character and myself as the viewer. In my final performance, the character very slowly approaches a paperclip, a light socket and eventually after a long, drawn out process, the relationship between the two objects interaction. As soon as they connect, he is wildly electrocuted and sent out into the physical world, into my hand (represented by the blinking glove). At this point I explode into dance. The performance is ended abruptly when the character shoots out of my hand and back onto screen. The end. The intention of the piece was to represent a pace of excruciatingly slow build-up and waiting, followed by extreme energy and speed, and an abrupt end. I also wanted to create a representation of a viewer being forced into an imaginary digital character's experience. I think I was able to accomplish this in my piece and I am very happy with the final product. I will post the video as soon as it is downloaded...

Here is an excerpt of my performance

Here is the clip of my performance:

December 19, 2009

Final Project - Ardrumo - Nick Gentle

My final project was essentially a modified construction of something that had already been created called Ardrumo, which was a series of drum pads wired to the Arduino that would send MIDI information through its USB connection into a program called Ardrumo, which would then communicate the MIDI information through Garageband.

The basic specifications for the Ardrumo can be found here:


* Ardrumo sketch
* Use with the Ardrumo software here:
* This is designed to let an Arduino act as a drum machine
* in GarageBand (sorry, Mac OS X only).

#define LEDPIN 13 // status LED pin
#define PIEZOTHRESHOLD 5 // analog threshold for piezo sensing
#define PADNUM 6 // number of pads

int val;

void setup() {
Serial.begin(57600); // set serial output rate

void loop() {

// Loop through each piezo and send data
// on the serial output if the force exceeds
// the piezo threshold
for(int i = 0; i < PADNUM; i++) {
val = analogRead(i);
if( val >= PIEZOTHRESHOLD ) {
digitalWrite(LEDPIN,HIGH); // indicate we're sending MIDI data
Here is the basic schematic for how everything is wired:


Unfortunately, my Mac crashed/probable hard drive failure (again) so I'm unable to give a screenshot of how Ardrumo is set up in Garageband. However, I can try to describe it textually. It's essentially one track in Garageband; a MIDI instrument/computer generated instrument track. It should be green. Then, under effects, select >Drums, then >Rock Set or >Hip Hop Set, depending on what kinds of sounds you want. That's basically it. Very little tech knowledge needed to run the Ardrumo through Garageband.

The larger, interactive implication for my idea came about during my periods of boredom either in class or sitting at a table trying to pass time. I, coming from a musical standpoint, am constantly in a state of writing music or "playing music". My constant tendencies to begin drumming with my hands and feet on the floor and on tables helped to construct this idea. I decided that it would be awesome if there were a way to bring my random "noodling" around on my "air" drums to life. Enter the Ardrumo. In a perfect world, I would have the peizo sensing pads somehow infused into table or some other inanimate object. This way, you still get the experience of being in a typical/mute/neutral location, while still being able to create audible drum sounds with your hands (where they would be amplified through speakers). Also in this way, the subject matter is always new and personal to the user.

-Nick Gentle

December 17, 2009

Fly on the Flash

fly on wall video

Fly on the wall

fly on the table

Using Flash, Arduino, and a potentiometer.
Here you can see how the potentiometer is used to scroll through the flash video, so that the viewer controls what they see. If anyone has questions about using flash, I can answer animation issues, but I'm not to familiar with the technical issues of connecting arduino with flash. But if you're interested, feel free to contact me. I'd be willing to help people out with flash animations if they ever need it.

December 15, 2009

Final Project Update - Alec Rippberger

For my final project I will be creating a link between the physical and digital realms. Interaction with a physical representation of a tree is linked with an animation of a tree projected onto a screen.

With online virtual communities replacing physical interaction, this installation is meant to make the viewer contemplate our interactions in life. What is more real, the physical or digital representation? Which is more meaningful or beautiful?


In the final presentation of this digital tree the more a viewer shakes the physical tree the more leaves will fall off the digital tree.

I used "serproxy" to act as an intermediate between Flash and the Arduino because the Arduino talks to the computer through the serial ports while Flash will only listen to a type of internet protocol. Serproxy acts as a translator allowing Flash and the Arduino to communicate. Serproxy can be downloaded from the Arduino page HERE. Serproxy was configured as so:

# Config file for serproxy
# See serproxy's README file for documentation

# Transform newlines coming from the serial port into nils
# true (e.g. if using Flash) or false

# Comm ports used



# Idle time out in seconds

# Port 1 settings (ttyS0)

# Port 2 settings (ttyS1)

# Port 3 settings (ttyS2)

# Port 4 settings (ttyS3)

To allow the Arduino to trigger the flash animation I used a Flash class called "as3Glue" which can be found HERE. THis flash class allows flash to check inputs and send output to the Arduino board.

I used "Firmata" to allow as3Glue to fluidly communicate with my Arduino. Firmata can be found HERE. I used the standard Firmata code with slight modification:

Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

See file LICENSE.txt for further informations on licensing terms.

formatted using the GNU C formatting and indenting

* TODO: add Servo support using setPinModeCallback(pin, SERVO);
* TODO: use Program Control to load stored profiles from EEPROM



/* analog inputs */
int analogInputsToReport = 0; // bitwise array to store pin reporting
int analogPin = 0; // counter for reading analog pins

/* digital pins */
byte reportPINs[TOTAL_PORTS]; // PIN == input port
byte previousPINs[TOTAL_PORTS]; // PIN == input port
byte pinStatus[TOTAL_DIGITAL_PINS]; // store pin status, default OUTPUT
byte portStatus[TOTAL_PORTS];

/* timer variables */
unsigned long currentMillis; // store the current value from millis()
unsigned long nextExecuteMillis; // for comparison with currentMillis
int samplingInterval = 19; // how often to run the main loop (in ms)

Servo servos[2]; // the servo library can control servos on pins 9 and 10 only


void outputPort(byte portNumber, byte portValue)
portValue = portValue &~ portStatus[portNumber];
if(previousPINs[portNumber] != portValue) {
Firmata.sendDigitalPort(portNumber, portValue);
previousPINs[portNumber] = portValue;
Firmata.sendDigitalPort(portNumber, portValue);

/* -----------------------------------------------------------------------------
* check all the active digital inputs for change of state, then add any events
* to the Serial output queue using Serial.print() */
void checkDigitalInputs(void)
byte i, tmp;
for(i=0; i < TOTAL_PORTS; i++) {
if(reportPINs[i]) {
switch(i) {
case 0:
outputPort(0, PIND &~ B00000011); // ignore Rx/Tx 0/1
case 1:
outputPort(1, PINB);
outputPort(ANALOG_PORT, PINC);

// -----------------------------------------------------------------------------
/* sets the pin mode to the correct state and sets the relevant bits in the
* two bit-arrays that track Digital I/O and PWM status
void setPinModeCallback(byte pin, int mode) {
byte port = 0;
byte offset = 0;

// TODO: abstract for different boards
if (pin < 8) {
port = 0;
offset = 0;
} else if (pin < 14) {
port = 1;
offset = 8;
} else if (pin < 22) {
port = 2;
offset = 14;

if(pin > 1) { // ignore RxTx (pins 0 and 1)
if(pin > 13)
reportAnalogCallback(pin - 14, mode == ANALOG ? 1 : 0); // turn on/off reporting
switch(mode) {
case ANALOG:
digitalWrite(pin, LOW); // disable internal pull-ups and fall thru to 'case INPUT:'
case INPUT:
pinStatus[pin] = mode;
pinMode(pin, INPUT);
portStatus[port] = portStatus[port] &~ (1 << (pin - offset));
case OUTPUT:
digitalWrite(pin, LOW); // disable PWM and fall thru to 'case PWM:'
case PWM:
pinStatus[pin] = mode;
pinMode(pin, OUTPUT);
portStatus[port] = portStatus[port] | (1 << (pin - offset));
case SERVO:
if((pin == 9 || pin == 10))
pinStatus[pin] = mode;
Firmata.sendString("Servo only on pins 9 and 10");
case I2C:
pinStatus[pin] = mode;
Firmata.sendString("I2C mode not yet supported");
Firmata.sendString("Unknown pin mode"); // TODO: put error msgs in EEPROM
// TODO: save status to EEPROM here, if changed

void analogWriteCallback(byte pin, int value)
switch(pinStatus[pin]) {
case SERVO:
if(pin == 9) servos[0].write(value);
if(pin == 10) servos[1].write(value);
case PWM:
analogWrite(pin, value);

void digitalWriteCallback(byte port, int value)
switch(port) {
case 0: // pins 2-7 (don't change Rx/Tx, pins 0 and 1)
// 0xFF03 == B1111111100000011 0x03 == B00000011
PORTD = (value &~ 0xFF03) | (PORTD & 0x03);
case 1: // pins 8-13 (14,15 are disabled for the crystal)
PORTB = (byte)value;
case 2: // analog pins used as digital
byte pin;
byte pinModeMask;
for(pin=0; pin<8; pin++)
if(pinStatus[pin] == OUTPUT)
pinModeMask += 1 << pin;
PORTC = (byte)value & pinModeMask;

// -----------------------------------------------------------------------------
/* sets bits in a bit array (int) to toggle the reporting of the analogIns
//void FirmataClass::setAnalogPinReporting(byte pin, byte state) {
void reportAnalogCallback(byte pin, int value)
if(value == 0) {
analogInputsToReport = analogInputsToReport &~ (1 << pin);
else { // everything but 0 enables reporting of that pin
analogInputsToReport = analogInputsToReport | (1 << pin);
setPinModeCallback(pin, ANALOG);
// TODO: save status to EEPROM here, if changed

void reportDigitalCallback(byte port, int value)
reportPINs[port] = (byte)value;
if(port == ANALOG_PORT) // turn off analog reporting when used as digital
analogInputsToReport = 0;

* SYSEX-BASED commands

void sysexCallback(byte command, byte argc, byte *argv)
switch(command) {
if(argc > 4) {
// these vars are here for clarity, they'll optimized away by the compiler
byte pin = argv[0] - 9; // servos are pins 9 and 10, so offset for array
int minPulse = argv[1] + (argv[2] << 7);
int maxPulse = argv[3] + (argv[4] << 7);
servos[pin].attach(argv[0], minPulse, maxPulse);
// TODO does the Servo have to be detach()ed before reconfiguring?
setPinModeCallback(pin, SERVO);
if (argc > 1)
samplingInterval = argv[0] + (argv[1] << 7);
Firmata.sendString("Not enough data");

void setup()
byte i;

Firmata.setFirmwareVersion(2, 1);

Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);
Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);
Firmata.attach(REPORT_ANALOG, reportAnalogCallback);
Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);
Firmata.attach(SET_PIN_MODE, setPinModeCallback);
Firmata.attach(START_SYSEX, sysexCallback);

portStatus[0] = B00000011; // ignore Tx/RX pins
portStatus[1] = B11000000; // ignore 14/15 pins
portStatus[2] = B00000000;

for(i=0; i setPinModeCallback(i,OUTPUT);
// set all outputs to 0 to make sure internal pull-up resistors are off
PORTB = 0; // pins 8-15
PORTC = 0; // analog port
PORTD = 0; // pins 0-7

// TODO rethink the init, perhaps it should report analog on default
for(i=0; i reportPINs[i] = false;
// TODO: load state from EEPROM here

/* send digital inputs here, if enabled, to set the initial state on the
* host computer, since once in the loop(), this firmware will only send
* digital data on change. */
if(reportPINs[0]) outputPort(0, PIND &~ B00000011); // ignore Rx/Tx 0/1
if(reportPINs[1]) outputPort(1, PINB);
if(reportPINs[ANALOG_PORT]) outputPort(ANALOG_PORT, PINC);


* LOOP()
void loop()
/* DIGITALREAD - as fast as possible, check for changes and output them to the
* FTDI buffer using Serial.print() */
currentMillis = millis();
if(currentMillis > nextExecuteMillis) {
nextExecuteMillis = currentMillis + samplingInterval;
/* SERIALREAD - uses a 128 byte circular buffer, so handle
* all serialReads at once, i.e. empty the buffer */
/* SEND FTDI WRITE BUFFER - make sure that the FTDI buffer doesn't go over
* 60 bytes. use a timer to sending an event character every 4 ms to
* trigger the buffer to dump. */

/* ANALOGREAD - right after the event character, do all of the
* analogReads(). These only need to be done every 4ms. */
for(analogPin=0;analogPin if( analogInputsToReport & (1 << analogPin) ) {
Firmata.sendAnalog(analogPin, analogRead(analogPin));

I will post the code of the Flash code and more documentation once all bugs have been worked out.

December 9, 2009

jane's One-on-One: prototype I

This project is an interactive wearable belt. The content relates to my and other women's experiences of permission to touch a pregnant stomach strangers give themselves. It will have two modes of operation: non-touch and touch. In non-touch mode red "warning" lights will flash. In touch mode, a series of interactions will be possible. Extracting the container with the fetus embryo model, will trigger a tilt sensor causing either a muscle wire to produce a small movement or a blue LED to glow in the fetus model. Touching the cast rubber will cause different actions depending on how touched. Still deciding on what these should be.

One-on-One Sketch-crop8xAdjs.jpg

December 8, 2009

Final Project Concept

Interactive Concept.jpg

I have become very interested in Processing over the past couple of weeks and have made a slight shift in the direction of the final project. As discussed last week, I am interested in a more "code intensive" project than previously.

The project will use several capacitive sensors to communicate with Processing via the Arduino. The serial inputs will create contained lighting condition on a surface. In addition the inputs will manipulate the duration, tempo, and frequency of an audio signal to create a hybrid sensory experience.

Final Project Progress

For my final project i plan on creating an interactive painting utilizing diffused LED's and light sensors. I am currently trying to work on the programming of the LED's so that I can get multiple LED's to turn on and off based on the light sensor. I have several options for the painting in my head but i have yet to decide which version i will decide to use. I am thinking of either a cityscape/landscape that will become lit up as the viewer blocks the light source or possibly an eclipse in which the moon will block the light sensor embedded in the sun. These options will depend on how far i can get with the programming.

December 4, 2009

Final Project Progress-Robin Schwartzman

My "tree installation" has been slowly progressing throughout the semester. As of right now, I have my flower bush complete, with about 50 different flower sounds that are triggered randomly when each flower is picked. I also have completed the clover mound, which is a game of sorts. When a three leaf clover is picked, it yells at you saying something like "nope", "wrong", "not me", and "can't you count?". When you find the four leaf clover and pick it, you are awarded with cheers and applause.
Here are some images of those pieces:



As far as the coding, right now all of my coding for the flowers and clovers is together with the background music (zip-a-dee-doo-dah) on one waveshield. When I get multiple waveshields, the sounds will be programmed separately so that they can start to build on eachother. The coding is here:


I've also made significant progress on the blinking apple tree. He blinks using a system with the stepper motor, an arduino motorshield, some thick aluminum wire, a sewing bobbin and fishing line. Here are two images-one with eyes closed, the next with eyes open. You can also see the picnic blanket hanging behind the tree. I still need to wire up a system underneath the blanket (with foam and aluminum foil) so that when one steps on the blanket, the tree will also talk.



Here is my coding for the blinking eyes:blinkyeyes.doc

More to come, looking forward to piecing everything together into a cohesive installation.

December 3, 2009

MIDI and such

For my final project, I'm planning on utilizing some piezo sensors to run through the Arduino, through the USB port, through a program that I found called Ardumo, and finally through Garageband, to be able to create essentially an electronic drumset using 6 piezo sensors, each with a different drum. I'm not deadset on making it strictly drums, but for simplicity's sake (and I enjoy simple) I might just leave it with drums.

Here is the website where I have been getting the information on how to construct this.

October 13, 2009

Processing Sketch Controlled by Arduino via Photoresistor

Photoresistor is connected to analog-in pin. Processing uses serial connection to listen to Arduino. Will post code and schematic this week.

Five Servo Motors Controlled by Arduino Via Photoresistors

Each servo motor is connected to a digital-out pin. Each photoresistor is connected to an analog-in pin. Arduino serves as bridge for communication between servos and photoresistors. Will post code and schematic this week.

September 22, 2009

Active Sketch #1

For this activity I decided to use a single color and explore its emotive and thematic elements, as well as articulate a simple concept for the interactive potential within a mixed media framework.

My design involved a clear plastic cylinder draped with a simple trace paper sketch. The green led was inside the cylinder shining through, illuminating the scene. A simple alteration in rhythm was meant to mimic the rhythms of nature.