Archive for the 'Uncategorized' Category

Beacon Pendants: Code

Posted in Uncategorized on July 2nd, 2008

//Beacon Locator Thing V 1.0  A slamming together of Rob Faludi’s RSSI Reader, and Tom Igoes Analog Duplex Sender Code
//by Chris Cerrito

//FOR XBEE2
//******************************************************************************int
int RSSI = 0; // holds the Recieved Signal Strength Value, the value used to range find the Xbees
int address = 0; //holds the 16 bit address of the incoming signal
int lastSender = 0; // last address we received an API packet from

//******************************************************************************#define

#define txLed 2 //indicates outgoing data
#define rxLed 3 //indicates incoming data
#define RedChannel 11 //red pwm pin
#define GreenChannel 9 //green pwm pin
#define BlueChannel 10 //blue pwm pin

int RedChanVal = 0;
int GreenChanVal = 0;
int BlueChanVal = 0;

unsigned long RedTimeOut = 0;
unsigned long GreenTimeOut = 0;
unsigned long StartTime = 0;

//*********************************************************************************

void setup() {
Serial.begin(9600); //Lets talk.
pinMode(txLed, OUTPUT);
pinMode(rxLed, OUTPUT);
pinMode(RedChannel, OUTPUT);
pinMode(GreenChannel, OUTPUT);
pinMode(BlueChannel, OUTPUT);
setDestination();
}

//***********************************************************************************WORKS?

void setDestination(){
blink(2);               //blink to indicate that the destination code is about to run
delay(1200);
Serial.print(”+++”); //throw Xbee into command mode
delay(500);
char thisByte = 0;
while (thisByte != ‘\r’) {           //Xbee will reply with an OK/r…wait for the ?r before printing
if (Serial.available() > 0) {      //if theres something in the serial, read it.
thisByte = Serial.read();
}
}
Serial.print(”ATDH0, DLFFFF\r”); //sets the address. Puts in the Xbee in Broadcast Mode—Anyone can listen
delay(10);
Serial.print(”ATMY0001\r”); //gives the Xbee an Address of 1. Use single digit addresses. CHANGE TO A DIFFERENT address fr each UNIT.
delay(10);
Serial.print(”ATID1124\r”); //set the PAN ID
delay(10);
Serial.print(”ATAP1\r”); //put the Xbee into API mode
delay(10);
Serial.print(”ATCN\r”); //take the Xbee out of command mode.
delay(1200);
blink(2);

}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++works

void blink(int howManyTimes) {
for (int i=0; i< howManyTimes; i++) {
digitalWrite(txLed, HIGH);
delay(200);
digitalWrite(txLed, LOW);
delay(1200);
}
}

//********************************************//Reads an API string

void APIread() {
if (Serial.available() > 13) {   //checks to make sure that we have received at least one frame worth of bytes
int inByte = Serial.read();    //reads the incoming API string
if (inByte == 0×7E) {          // (first byte)looks for tilda (ox7E) place holder…marks the beginning of the string
for (int i=0;i<4;i++) {
int junk = Serial.read();  // (next four bytes)  reads and discards the next four bytes that we’re not going to use
}

address = Serial.read();       // the sixth byte is the low part of the address (ONLY USE ONE BYTE ADDRESSES!)
RSSI = Serial.read();          // the seventh byte is the RSSI value

for (int i=0;i<7;i++) {
int junk = Serial.read();     //reads and discards the last six bytes of the API string. We dont need them. Whats in them? beats the crap outta me.
}

AssignValues();                 //if there are values to assign from a successful serial read, assign them.
}
}

}

//*******************************************//

void AssignValues() {

if (address == 0003) {                              //if Xbee 3 is detected, give the red channel a value
GreenChanVal=(100-RSSI)*2;
GreenTimeOut=  millis();
}

if (address == 0002) {                         //if Xbee2 is detected, give the green channel a value
RedChanVal=(100-RSSI)*2;
RedTimeOut = millis();
}

if (address > 0) {                         //if an address is recieved (Showing that the Xbee has
digitalWrite(rxLed, HIGH);               //received and processed info.
}
else
{digitalWrite(rxLed, LOW);
}
}
//********************************************

void Lightup() {
analogWrite(GreenChannel, GreenChanVal);
analogWrite(RedChannel, RedChanVal);
}

//**********************************************

void Timeout() {

if ((millis() - GreenTimeOut) > 1000) {
GreenChanVal=0;
}

if ((millis() - RedTimeOut) > 1000) {
RedChanVal=0;
}
}

//*********************************************

void Sendjunk() {
digitalWrite(txLed, HIGH);
sendData(”X”,0xFFFF);    //SETS ADDRESS IS REDUNDANT
delay(50);
digitalWrite(txLed, LOW);
}

//*******************************************

void loop () {
StartTime = millis();
APIread();
Lightup();
Sendjunk();
Timeout();
Serial.print(”GreenChanVal”);
Serial.print(GreenChanVal);
Serial.print(”RedChanVal”);
Serial.print(RedChanVal);
}

The Beacon Pendants

Posted in sociable objects, Uncategorized on July 2nd, 2008

Beacon Pendants

For my sociable objects final I decided to work on a project thats been the in back of my mind for quite some time. I’ve always wanted to make “social” jewelry; small wearable objects that have the ability to know if there are others of their kind in the area. For instance, say you were wearing, oh, i dunno, a pendant, and your friend had on a similar piece. Perhaps each pendant would glow, the closer the two of you are together, the brighter the response, the further apart, the dimmer. Say maybe there were three pendants, and each pendant had a specific color assigned to it; You were wearing the blue necklace, your friend the green, and your other friend the red. When the three of you were together, the pendants would flash brightly between all three colors, indicating social cohesion among the group. If one friend left early, the color show would be reduced to just two tones, and finally, when everyone parts ways, you would be left with a necklace dimly glowing it’s assigned color.

Another interesting idea: say the pendants were somewhat directional…Remember rabbit ears? Back in the day of braodcast TV (a world I’m afraid I still live in) you would have to adjust your antennae in order to pick up a station clearly. Say you were wearing one of these objects, and you suddenly noticed a flash of red, indicating that your friend was somewhere in the crowd. Using the pendant like a divining rod of sorts, you maneuver through the crowd, watching the light grow dimmer or stronger based the relative locations of both parties. Maybe you would be able to find one another?

And, finally, what if you were, say, at a huge party in the middle of the desert wearing a big furry coat, a space helmet, and stuck on sensory overload. A little help finding your way back to your camp would surely be a good thing. Perhaps there could be a beacon of sorts, broadcasting a much stronger signal then the pendants themselves, but in their range of hearing. Maybe, just maybe, you could navigate your way home using a somewhat directional antennae….

So, in a nutshell, thats pretty much what I tried to accomplish. I haven’t gotten all the way there yet, but I do feel as though I’ve made significant progress. I’m using Xbees broadcasting API packets, and giving each unit the ability to parse those packets out, seeing who they’re from, and the signal strength of each unit in the system. Right now I have three breadboarded circuits, the “pendants” themselves, up and running. Theres a ton more to do, including shrinking these things down to a wearable size, but I think it’s all doable.

Below is a video of each circuit in action. Though they’re not mobile (i was so shocked that things actually worked that I didn’t want to ruin it by moving), each unit can see wach other, as indicated by the flashing tricolor RGB LEDS.

The diagram above is basically how I envision the system working.

Take a look below:


Trash Talk

Posted in Living Art, Physical Computing, Personal, Uncategorized on July 2nd, 2008

Trash Talk is in Conflux this year….

MRS. DESI LIVES!!!!

I’ll be posting info about the rebuild as it happens. Should be pretty damn good.

The BLT

Posted in Uncategorized on June 16th, 2008

blt-schematic001.jpg

Posted in Uncategorized on June 16th, 2008

file:///Users/christiancerrito/Desktop/BLT%20schematic.001.jpg

Draw Synth

Posted in Uncategorized on March 6th, 2008

I’ve been terrible about updating my blog this semester, and have resolved to nip that in the bud.  For my Living Art Midterm, I’m building a draw synth. I’m not exactly sure what this means yet, but I do know that it will involve resistence from graphite/pencil lead that you put on a paper. I’m hoping I can rig a simple synth based on a 4093 NAND gate oscillator that responds to the resistence from lines drawn on paper. I might end up with a big, noisy, piece of nonsense. It’s very important to me that this thing sound SOMEWHAT interesting, and this is the first time I’ve ever messed around with chip-tunes. I hope I dont end up in a big mess. We’ll see.  

Toy Idea 1:

Posted in Uncategorized on February 21st, 2008

mustache1.jpg

Toy Idea 4:

Posted in Uncategorized on February 21st, 2008

mustache.jpg

The Pinhole Painter: Software

Posted in Computational Media, Physical Computing, Uncategorized on December 16th, 2007

The software for the pinhole painter involves both arduino and processing. 18 sensor values (the 16 photocells from the MUX, along with values from the two IRs) are sent to processing via serial, parsed into pieces, and then plugged into arrays which transfer the photocell values into corresponding greyscales. The greyscales are then “painted” along the screen.

In order to ensure accuracy, the IR values are averaged in arduino before being sent to processing.

//ARDUINO CODE — ASCII SENDER
int val[16];
int analog1[5];
int h, j;
long average1;
int analog2[5];
int p, q;
long average2;

int a= 3; // SELECT PIN A0 GOING INTO PIN 2
int b= 4; // SELECT PIN A1 GOING INTO PIN 3
int c= 5; // SELECT PIN A2 GOING INTO PIN 4
int d= 6; // SELECT PIN A3 GOING INTO PIN 5
//we are using three analog pins
int analog0 = 0;
//int analog1 = 0;
//int analog2 = 0;

void setup() {
Serial.begin(9600);
pinMode(analog0, INPUT);
pinMode(a,OUTPUT);
pinMode(b,OUTPUT);
pinMode(c,OUTPUT);
pinMode(d,OUTPUT);
//pinMode(analog1, INPUT);
//pinMode(analog2, INPUT);
}

void loop() {

for (int i = 0; i > 1) ;
// shift value 2 bits to the right, and mask all but bit 0:
int pinThree = 1 & (i >> 2);
// shift value 3 bits to the right, and mask all but bit 0:
int pinFour = 1 & (i >> 3);

// set the address pins:
digitalWrite(a,pinOne);
digitalWrite(b,pinTwo);
digitalWrite(c,pinThree);
digitalWrite(d,pinFour);

// read the analog input and store it in the value array:
val[i] = analogRead(analog0);

//val[i] = i;
Serial.print(val[i], DEC);
if (i

The Pinhole Painter: Mounting the CCD

Posted in Computational Media, Physical Computing, Uncategorized on December 16th, 2007

Got the new, IMPROVED, 16 photocell ccd up and mounted. After massive wiring issues with the first cell (too many wires that weren’t flexible enough to allow movement), we gave the cells a common power source, and wired their outputs with ethernet cable. The result was much tidier, though I am a little freaked out by the fact that all the cells are now linked…much harder to deal with this way on the technical side, but this improvement should result in a more user friendly experience.

p7170088.JPG