Posts Tagged ‘serial’

Beat Feet– code incarnate

Thursday, December 31st, 2009

The code for Beat Feet is massive, and Eric did  a great job of commenting the whole thing. Below is a zipped file ready for download. Or you can copy and paste the code below, but it won’t have tabs for classes.

Happy foot beating.

ZIP!

beat_feet

// Beat Feat
// Shoes that make sound.
// Yin Ho, Eric Mika, Arturo Vidich
// ITP Fall 2009
import processing.serial.*;
import controlP5.*;
import ddf.minim.*;
import arb.soundcipher.*;
import javax.swing.*;
Looper looper; // Handles cueing looped sequences in its own thread.
ControlP5 controlP5; // Sliders, buttons, etc.
Serial port; // Listen to the shoes.
Textlabel loopCount; // Keeps track of how many layers of loops we’re in.

Mental Block– tha code

Wednesday, December 30th, 2009

Below is the code that was uploaded to each Arduino in each headset. Kudos to Eric for the noble task of commenting. It’s easier to read if you copy/paste into the Arduino IDE or another IDE like Eclipse.

Or you can just download the zipped file available right below.

ZIP!

MentalBlockCode

// MENTAL BLOCK
// Parses packets from a Neurosky chip to collect EEG-derrived
// “attention” and “medidation” values.
// Uses these values to set the position of a polarized disk mounted
// on a servo.

#include <SoftwareServo.h>
#include <NewSoftSerial.h>

// Give the headset an ID. Useful for debugging over serial.
int id = 1;

// Set up the polarizer disk servo.
// Using the SoftwareServo library because I suspected the
// built-in library was conflicting with the NewSoftSerial
// library.
SoftwareServo servo;
int currentPos = 45; // Start halfway between the 0 – 90 degrees we care about.
int targetPos = 45; // The target tells the servo where it should move towards.
int servoPin = 9;
unsigned long lastMovement = 0; // Track time so we can move the servo at regular intervals without delay().

// Set up the simulator for brainless testing.
unsigned long lastSimulatedPacket = 0;

// NeuroSky Parser and Serial Communication.
(more…)

Beat Feet– documentation

Monday, December 28th, 2009

The shoes.

They didn’t make themselves, that’s for sure. The documentation for how we made the perfboards for the wireless modules can be found on a flickr photostream here, and the rest of the documentation (code, etc) can be found at our website here.

The show went really well, with just a couple minor set-backs.  My computer kept crashing when I tried to do more than one layer of looping in MIDI. Closing and restarting the Processing sketch seemed to help for a while. Looking back, I really wish we’d found a way to cycle through the preset MIDI files we created, a way to cycle through using a gesture, or the hat somehow. Switching over to the sound sample files from MIDI would have been great… as it was, I had to stop the sketch, change SYNTH to SAMPLE, and then re-run it.

People seemed to enjoy trying to figure out if the floor was sensing my weight, and what exactly the hat was doing. Tom told me not to talk to people at first, but to simply dance, and people would respond or be intrigued by what was happening. After dancing for 10 hours in the shoes, I finally understood how to use them and the little performative tricks I could play to make it seem like there was more going on than there really was. One of the perks of having a team in this case was that Yin could explain what was happening while I just danced a storm.

Serial Lab 2 (spongey!)

Monday, November 30th, 2009

The second serial lab. There is a lot to learn when it comes to serial communication between devices and applications. No doubt I will be working hard over the winter break to get serial communication into my blood, to have the handshake method down cold, to master punctuation and prevent binary from byting my ASCII. Sending data serially is a beautiful, complex beast. Most of what’s covered in the two serial labs was key in Beat Feet, the mid-term project that Eric, Yin and I built. We used Zigbees to send data from sensors on a pair of shoes and hat to the computer which played back sound files or MIDI library depending on which sensor was triggered. What we did with that project was more interesting and involved than what I ended up making for the second serial lab, which is basically what was outlined in the examples. The video at the bottom shows an accelerometer and an Arduino used to move a ball around on the screen in Processing. The button makes the ball appear or disappear. (more…)

Shoe Music (aka BeatFeet)

Thursday, October 29th, 2009

Or maybe we should call it BetaFeta, but that would be cheesy. If we’re in a triumphant vegetative state, BeetFeat.

(more…)

Serial Lab #1 (crunchy!)

Wednesday, October 28th, 2009

I like working with serial from Arduino to Processing. It makes me a little giddy.

(more…)