Connie – Final Project
This project features a lovely, be-jeweled turd that talks. The LEDs are synced with the audio to create the illusion that the turd is, in fact, do the talking. I had originally hoped to make this as an example of how people say things that are insubstantial and amount to basically a pile of crap. Though now looking at it the poop seems to become a character of its own – that may one day rise above its state of abject shit and evolve into the most fabulous poo that ever pooped.
A Shitty Spiel from Connie D on Vimeo.
The audio file was originally played in processing where the values were then sent to Arduino.
Processing:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | import processing.serial.*; Serial myArduinoSerial; int valueToSend; import ddf.minim.*; Minim minim; AudioPlayer diatribe; PImage goldenpoop; void setup() { size(249, 188); goldenpoop = loadImage("goldenpoop.jpg"); minim = new Minim(this); diatribe = minim.loadFile("poopy.mp3"); float vol = diatribe.getVolume(); println(Serial.list()); myArduinoSerial = new Serial (this, Serial.list()[0], 9600); } void draw() { image (goldenpoop, 0, 0); AudioBuffer theBuf = diatribe.mix; float vol = theBuf.level(); float convertedVol = map(vol, 0, 1, 0, 255); valueToSend = (int)convertedVol; vol = diatribe.getVolume(); println("volume: " + valueToSend); myArduinoSerial.write(valueToSend); } void mousePressed() { diatribe.rewind(); diatribe.play(); } void stop() { diatribe.close(); minim.stop(); super.stop(); } |
Arduino:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | const int leds[ ] = { 3, 5, 6, 9, 10, 11}; void setup() { // initialize the serial communication: Serial.begin(9600); for (int i=0; i< 6; i++){ pinMode (leds[i], OUTPUT); } } void loop() { byte brightness; if (Serial.available()) { brightness = Serial.read(); for (int i=0; i<6; i++){ analogWrite(leds[i], brightness); } } } |