Category Archives: Assignments

Final Project: Uglydoll Maker

Using a controller with 3 potentiometers – one to select the color, tab, and attribute – make your very own Uglydoll! This project was made using Arduino and Processing.

fbguj

controller

// Jessy Jo Gomez
// uglydoll maker (final)

float currentTab = 1;
float currentBox = 0;
float currentColor = 0;
float bodyType = 0;
float eyesType = 0;
float noseType = 2;
float mouthType = 0;

int bodyX = 1;
int bodyY = 1;
int eyesX = 1;
int eyesY = 1;
int noseX = 1;
int noseY = 1;
int mouthX = 1;
int mouthY = 1;

int selectColor = 0;
int selectTab = 0;
int selectAttribute = 0;

PImage template;
PImage tabBody;
PImage tabEyes;
PImage tabNose;
PImage tabMouth;
PImage currentBody;
PImage currentEyes;
PImage currentNose;
PImage currentMouth;

// TODO 1: copy these (3 lines):
import processing.serial.*;
Serial port; // The serial port object
boolean sending = false;

void setup() {

// TODO 2: copy these (2 lines):
// Using the first available port (might be different on your computer)
port = new Serial(this, Serial.list()[0], 9600);

size (550, 400);

template = loadImage(“template.png”);
currentBody = loadImage(“spacer.gif”);
currentEyes = loadImage(“spacer.gif”);
currentNose = loadImage(“spacer.gif”);
currentMouth = loadImage(“spacer.gif”);
tabBody = loadImage(“tabBody.png”);
tabEyes = loadImage(“tabEyes.png”);
tabNose = loadImage(“tabNose.png”);
tabMouth = loadImage(“tabMouth.png”);
}

void draw() {

image(template, 0, 0);
image(currentBody, bodyX, bodyY);
image(currentEyes, eyesX, eyesY);
image(currentNose, noseX, noseY);
image(currentMouth, mouthX, mouthY);

// tab positions

if ( selectTab > 0 && selectTab < 63 ) {
currentTab = 1;
}
if ( selectTab > 63 && selectTab < 126 ) {
currentTab = 2;
}
if ( selectTab > 126 && selectTab < 189 ) {
currentTab = 3;
}
if ( selectTab > 189 && selectTab < 255 ) {
currentTab = 4;
}

// color positions

if ( selectColor > 0 && selectColor < 31 ) {
currentColor = 0;
}
if ( selectColor > 31 && selectColor < 62 ) {
currentColor = 1;
}
if ( selectColor > 62 && selectColor < 93 ) {
currentColor = 2;
}
if ( selectColor > 93 && selectColor < 124 ) {
currentColor = 3;
}
if ( selectColor > 124 && selectColor < 155 ) {
currentColor = 4;
}
if ( selectColor > 155 && selectColor < 186 ) {
currentColor = 5;
}
if ( selectColor > 186 && selectColor < 217 ) {
currentColor = 6;
}
if ( selectColor > 217 && selectColor < 255 ) {
currentColor = 7;
}

// body tab

if ( currentTab == 1 ) {
image(tabBody, 288, -1);
if ( selectAttribute > 0 && selectAttribute < 42 ) {
currentBody = loadImage(“baboGrey.png”);
bodyType = 1;
bodyX = 205;
bodyY = 213;
}
if ( selectAttribute > 42 && selectAttribute < 84 ) {
currentBody = loadImage(“plunkoGrey.png”);
bodyType = 2;
bodyX = 206;
bodyY = 174;
}
if ( selectAttribute > 84 && selectAttribute < 126 ) {
currentBody = loadImage(“icebatGrey.png”);
bodyType = 3;
bodyX = 182;
bodyY = 189;
}
if ( selectAttribute > 126 && selectAttribute < 168 ) {
currentBody = loadImage(“uglywormGrey.png”);
bodyType = 4;
bodyX = 208;
bodyY = 218;
}
if ( selectAttribute > 168 && selectAttribute < 210 ) {
currentBody = loadImage(“wedgeheadGrey.png”);
bodyType = 5;
bodyX = 218;
bodyY = 218;
}
if ( selectAttribute > 210 && selectAttribute < 255 ) {
currentBody = loadImage(“feebeeGrey.png”);
bodyType = 6;
bodyX = 214;
bodyY = 186;
}
}

// babo’s colors

if ( bodyType == 1 ) {
if ( currentColor == 0 ) {
currentBody = loadImage(“baboGrey.png”);
}
if ( currentColor == 1 ) {
currentBody = loadImage(“baboRed.png”);
}
if ( currentColor == 2 ) {
currentBody = loadImage(“baboOrange.png”);
}
if ( currentColor == 3 ) {
currentBody = loadImage(“baboYellow.png”);
}
if ( currentColor == 4 ) {
currentBody = loadImage(“baboGreen.png”);
}
if ( currentColor == 5 ) {
currentBody = loadImage(“baboBlue.png”);
}
if ( currentColor == 6 ) {
currentBody = loadImage(“baboPurple.png”);
}
if ( currentColor == 7 ) {
currentBody = loadImage(“baboBlack.png”);
}
}

// plunko’s colors

if ( bodyType == 2 ) {
if ( currentColor == 0 ) {
currentBody = loadImage(“plunkoGrey.png”);
}
if ( currentColor == 1 ) {
currentBody = loadImage(“plunkoRed.png”);
}
if ( currentColor == 2 ) {
currentBody = loadImage(“plunkoOrange.png”);
}
if ( currentColor == 3 ) {
currentBody = loadImage(“plunkoYellow.png”);
}
if ( currentColor == 4 ) {
currentBody = loadImage(“plunkoGreen.png”);
}
if ( currentColor == 5 ) {
currentBody = loadImage(“plunkoBlue.png”);
}
if ( currentColor == 6 ) {
currentBody = loadImage(“plunkoPurple.png”);
}
if ( currentColor == 7 ) {
currentBody = loadImage(“plunkoBlack.png”);
}
}

// icebat’s colors

if ( bodyType == 3 ) {
if ( currentColor == 0 ) {
currentBody = loadImage(“icebatGrey.png”);
}
if ( currentColor == 1 ) {
currentBody = loadImage(“icebatRed.png”);
}
if ( currentColor == 2 ) {
currentBody = loadImage(“icebatOrange.png”);
}
if ( currentColor == 3 ) {
currentBody = loadImage(“icebatYellow.png”);
}
if ( currentColor == 4 ) {
currentBody = loadImage(“icebatGreen.png”);
}
if ( currentColor == 5 ) {
currentBody = loadImage(“icebatBlue.png”);
}
if ( currentColor == 6 ) {
currentBody = loadImage(“icebatPurple.png”);
}
if ( currentColor == 7 ) {
currentBody = loadImage(“icebatBlack.png”);
}
}

// uglyworm’s colors

if ( bodyType == 4 ) {
if ( currentColor == 0 ) {
currentBody = loadImage(“uglywormGrey.png”);
}
if ( currentColor == 1 ) {
currentBody = loadImage(“uglywormRed.png”);
}
if ( currentColor == 2 ) {
currentBody = loadImage(“uglywormOrange.png”);
}
if ( currentColor == 3 ) {
currentBody = loadImage(“uglywormYellow.png”);
}
if ( currentColor == 4 ) {
currentBody = loadImage(“uglywormGreen.png”);
}
if ( currentColor == 5 ) {
currentBody = loadImage(“uglywormBlue.png”);
}
if ( currentColor == 6 ) {
currentBody = loadImage(“uglywormPurple.png”);
}
if ( currentColor == 7 ) {
currentBody = loadImage(“uglywormBlack.png”);
}
}

// wedgehead’s colors

if ( bodyType == 5 ) {
if ( currentColor == 0 ) {
currentBody = loadImage(“wedgeheadGrey.png”);
}
if ( currentColor == 1 ) {
currentBody = loadImage(“wedgeheadRed.png”);
}
if ( currentColor == 2 ) {
currentBody = loadImage(“wedgeheadOrange.png”);
}
if ( currentColor == 3 ) {
currentBody = loadImage(“wedgeheadYellow.png”);
}
if ( currentColor == 4 ) {
currentBody = loadImage(“wedgeheadGreen.png”);
}
if ( currentColor == 5 ) {
currentBody = loadImage(“wedgeheadBlue.png”);
}
if ( currentColor == 6 ) {
currentBody = loadImage(“wedgeheadPurple.png”);
}
if ( currentColor == 7 ) {
currentBody = loadImage(“wedgeheadBlack.png”);
}
}

// feebee’s colors

if ( bodyType == 6 ) {
if ( currentColor == 0 ) {
currentBody = loadImage(“feebeeGrey.png”);
}
if ( currentColor == 1 ) {
currentBody = loadImage(“feebeeRed.png”);
}
if ( currentColor == 2 ) {
currentBody = loadImage(“feebeeOrange.png”);
}
if ( currentColor == 3 ) {
currentBody = loadImage(“feebeeYellow.png”);
}
if ( currentColor == 4 ) {
currentBody = loadImage(“feebeeGreen.png”);
}
if ( currentColor == 5 ) {
currentBody = loadImage(“feebeeBlue.png”);
}
if ( currentColor == 6 ) {
currentBody = loadImage(“feebeePurple.png”);
}
if ( currentColor == 7 ) {
currentBody = loadImage(“feebeeBlack.png”);
}
}

// eyes tab

if ( currentTab == 2 ) {
image(tabEyes, 288, -1);
if ( selectAttribute > 0 && selectAttribute < 42 ) {
currentEyes = loadImage(“eyes1.png”);
eyesType = 1;
}
if ( selectAttribute > 42 && selectAttribute < 84 ) {
currentEyes = loadImage(“eyes2.png”);
eyesType = 2;
}
if ( selectAttribute > 84 && selectAttribute < 126 ) {
currentEyes = loadImage(“eyes3.png”);
eyesType = 3;
}
if ( selectAttribute > 126 && selectAttribute < 168 ) {
currentEyes = loadImage(“eyes4.png”);
eyesType = 4;
}
if ( selectAttribute > 168 && selectAttribute < 210 ) {
currentEyes = loadImage(“eyes5.png”);
eyesType = 5;
}
if ( selectAttribute > 210 && selectAttribute < 255 ) {
currentEyes = loadImage(“eyes6.png”);
eyesType = 6;
}
}

if ( bodyType == 0 ) {
currentEyes = loadImage(“spacer.gif”);
}

// babo’s eyes

if ( bodyType == 1 ) {
if ( eyesType == 1 || eyesType == 4 || eyesType == 6 ) {
eyesX = 243;
eyesY = 233;
}
if ( eyesType == 2 || eyesType == 5 ) {
eyesX = 263;
eyesY = 233;
}
if ( eyesType == 3 ) {
eyesX = 245;
eyesY = 226;
}
}

// plunko’s eyes

if ( bodyType == 2 ) {
if ( eyesType == 1 || eyesType == 4 || eyesType == 6 ) {
eyesX = 250;
eyesY = 227;
}
if ( eyesType == 2 || eyesType == 5 ) {
eyesX = 270;
eyesY = 227;
}
if ( eyesType == 3 ) {
eyesX = 252;
eyesY = 220;
}
}

// icebat’s eyes

if ( bodyType == 3 ) {
if ( eyesType == 1 || eyesType == 4 || eyesType == 6 ) {
eyesX = 243;
eyesY = 233;
}
if ( eyesType == 2 || eyesType == 5 ) {
eyesX = 263;
eyesY = 233;
}
if ( eyesType == 3 ) {
eyesX = 245;
eyesY = 226;
}
}

// uglyworm’s eyes

if ( bodyType == 4 ) {
if ( eyesType == 1 || eyesType == 4 || eyesType == 6 ) {
eyesX = 229;
eyesY = 233;
}
if ( eyesType == 2 || eyesType == 5 ) {
eyesX = 249;
eyesY = 233;
}
if ( eyesType == 3 ) {
eyesX = 231;
eyesY = 226;
}
}

// wedgehead’s eyes

if ( bodyType == 5 ) {
if ( eyesType == 1 || eyesType == 4 || eyesType == 6 ) {
eyesX = 243;
eyesY = 230;
}
if ( eyesType == 2 || eyesType == 5 ) {
eyesX = 263;
eyesY = 230;
}
if ( eyesType == 3 ) {
eyesX = 245;
eyesY = 223;
}
}

// feebee’s eyes

if ( bodyType == 6 ) {
if ( eyesType == 1 || eyesType == 4 || eyesType == 6 ) {
eyesX = 249;
eyesY = 200;
}
if ( eyesType == 2 || eyesType == 5 ) {
eyesX = 269;
eyesY = 200;
}
if ( eyesType == 3 ) {
eyesX = 251;
eyesY = 193;
}
}

// nose tab

if ( currentTab == 3 ) {
image(tabNose, 288, -1);
if ( selectAttribute > 0 && selectAttribute < 127 ) {
currentNose = loadImage(“nose1.png”);
noseType = 1;
}
if ( selectAttribute > 127 && selectAttribute < 255 ) {
currentNose = loadImage(“spacer.gif”);
noseType = 2;
}
}

if ( bodyType == 0 ) {
currentNose = loadImage(“spacer.gif”);
}

// nose positions

if ( bodyType == 1 && noseType == 1 || bodyType == 1 && noseType == 2 ) {
noseX = 258;
noseY = 251;
}
if ( bodyType == 2 && noseType == 1 || bodyType == 2 && noseType == 2 ) {
noseX = 265;
noseY = 245;
}
if ( bodyType == 3 && noseType == 1 || bodyType == 3 && noseType == 2 ) {
noseX = 258;
noseY = 251;
}
if ( bodyType == 4 && noseType == 1 || bodyType == 4 && noseType == 2 ) {
noseX = 244;
noseY = 251;
}
if ( bodyType == 5 && noseType == 1 || bodyType == 5 && noseType == 2 ) {
noseX = 258;
noseY = 248;
}
if ( bodyType == 6 && noseType == 1 || bodyType == 6 && noseType == 2 ) {
noseX = 264;
noseY = 218;
}

// mouth tab

if ( currentTab == 4 ) {
image(tabMouth, 288, -1);
if ( selectAttribute > 0 && selectAttribute < 42 ) {
currentMouth = loadImage(“mouth1.png”);
mouthType = 1;
}
if ( selectAttribute > 42 && selectAttribute < 84 ) {
currentMouth = loadImage(“mouth2.png”);
mouthType = 2;
}
if ( selectAttribute > 84 && selectAttribute < 126 ) {
currentMouth = loadImage(“mouth3.png”);
mouthType = 3;
}
if ( selectAttribute > 126 && selectAttribute < 168 ) {
currentMouth = loadImage(“mouth4.png”);
mouthType = 4;
}
if ( selectAttribute > 168 && selectAttribute < 210 ) {
currentMouth = loadImage(“mouth5.png”);
mouthType = 5;
}
if ( selectAttribute > 210 && selectAttribute < 255 ) {
currentMouth = loadImage(“mouth6.png”);
mouthType = 6;
}
}

if ( bodyType == 0 ) {
currentMouth = loadImage(“spacer.gif”);
}

// babo’s mouth

if ( bodyType == 1 && noseType == 2 && mouthType == 1 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 1 && noseType == 1 && mouthType == 1 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 1 && noseType == 2 && mouthType == 2 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 1 && noseType == 1 && mouthType == 2 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 1 && noseType == 2 && mouthType == 3 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 1 && noseType == 1 && mouthType == 3 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 1 && noseType == 2 && mouthType == 4 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 1 && noseType == 1 && mouthType == 4 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 1 && noseType == 2 && mouthType == 5 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 1 && noseType == 1 && mouthType == 5 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 1 && noseType == 2 && mouthType == 6 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 1 && noseType == 1 && mouthType == 6 ) {
mouthX = 240;
mouthY = 265;
}

// plunko’s mouth

if ( bodyType == 2 && noseType == 2 && mouthType == 1 ) {
mouthX = 247;
mouthY = 250;
}
if ( bodyType == 2 && noseType == 1 && mouthType == 1 ) {
mouthX = 247;
mouthY = 259;
}
if ( bodyType == 2 && noseType == 2 && mouthType == 2 ) {
mouthX = 247;
mouthY = 250;
}
if ( bodyType == 2 && noseType == 1 && mouthType == 2 ) {
mouthX = 247;
mouthY = 259;
}
if ( bodyType == 2 && noseType == 2 && mouthType == 3 ) {
mouthX = 247;
mouthY = 250;
}
if ( bodyType == 2 && noseType == 1 && mouthType == 3 ) {
mouthX = 247;
mouthY = 259;
}
if ( bodyType == 2 && noseType == 2 && mouthType == 4 ) {
mouthX = 247;
mouthY = 250;
}
if ( bodyType == 2 && noseType == 1 && mouthType == 4 ) {
mouthX = 247;
mouthY = 259;
}
if ( bodyType == 2 && noseType == 2 && mouthType == 5 ) {
mouthX = 247;
mouthY = 250;
}
if ( bodyType == 2 && noseType == 1 && mouthType == 5 ) {
mouthX = 247;
mouthY = 259;
}
if ( bodyType == 2 && noseType == 2 && mouthType == 6 ) {
mouthX = 247;
mouthY = 250;
}
if ( bodyType == 2 && noseType == 1 && mouthType == 6 ) {
mouthX = 247;
mouthY = 259;
}

// icebat’s mouth

if ( bodyType == 3 && noseType == 2 && mouthType == 1 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 3 && noseType == 1 && mouthType == 1 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 3 && noseType == 2 && mouthType == 2 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 3 && noseType == 1 && mouthType == 2 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 3 && noseType == 2 && mouthType == 3 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 3 && noseType == 1 && mouthType == 3 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 3 && noseType == 2 && mouthType == 4 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 3 && noseType == 1 && mouthType == 4 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 3 && noseType == 2 && mouthType == 5 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 3 && noseType == 1 && mouthType == 5 ) {
mouthX = 240;
mouthY = 265;
}
if ( bodyType == 3 && noseType == 2 && mouthType == 6 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 3 && noseType == 1 && mouthType == 6 ) {
mouthX = 240;
mouthY = 265;
}

// uglyworm’s mouth

if ( bodyType == 4 && noseType == 2 && mouthType == 1 ) {
mouthX = 226;
mouthY = 256;
}
if ( bodyType == 4 && noseType == 1 && mouthType == 1 ) {
mouthX = 226;
mouthY = 265;
}
if ( bodyType == 4 && noseType == 2 && mouthType == 2 ) {
mouthX = 226;
mouthY = 256;
}
if ( bodyType == 4 && noseType == 1 && mouthType == 2 ) {
mouthX = 226;
mouthY = 265;
}
if ( bodyType == 4 && noseType == 2 && mouthType == 3 ) {
mouthX = 226;
mouthY = 256;
}
if ( bodyType == 4 && noseType == 1 && mouthType == 3 ) {
mouthX = 226;
mouthY = 265;
}
if ( bodyType == 4 && noseType == 2 && mouthType == 4 ) {
mouthX = 226;
mouthY = 256;
}
if ( bodyType == 4 && noseType == 1 && mouthType == 4 ) {
mouthX = 226;
mouthY = 265;
}
if ( bodyType == 4 && noseType == 2 && mouthType == 5 ) {
mouthX = 226;
mouthY = 256;
}
if ( bodyType == 4 && noseType == 1 && mouthType == 5 ) {
mouthX = 226;
mouthY = 265;
}
if ( bodyType == 4 && noseType == 2 && mouthType == 6 ) {
mouthX = 226;
mouthY = 256;
}
if ( bodyType == 4 && noseType == 1 && mouthType == 6 ) {
mouthX = 226;
mouthY = 265;
}

// wedgehead’s mouth

if ( bodyType == 5 && noseType == 2 && mouthType == 1 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 5 && noseType == 1 && mouthType == 1 ) {
mouthX = 240;
mouthY = 262;
}
if ( bodyType == 5 && noseType == 2 && mouthType == 2 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 5 && noseType == 1 && mouthType == 2 ) {
mouthX = 240;
mouthY = 262;
}
if ( bodyType == 5 && noseType == 2 && mouthType == 3 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 5 && noseType == 1 && mouthType == 3 ) {
mouthX = 240;
mouthY = 262;
}
if ( bodyType == 5 && noseType == 2 && mouthType == 4 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 5 && noseType == 1 && mouthType == 4 ) {
mouthX = 240;
mouthY = 262;
}
if ( bodyType == 5 && noseType == 2 && mouthType == 5 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 5 && noseType == 1 && mouthType == 5 ) {
mouthX = 240;
mouthY = 262;
}
if ( bodyType == 5 && noseType == 2 && mouthType == 6 ) {
mouthX = 240;
mouthY = 256;
}
if ( bodyType == 5 && noseType == 1 && mouthType == 6 ) {
mouthX = 240;
mouthY = 262;
}

// feebee’s mouth

if ( bodyType == 6 && noseType == 2 && mouthType == 1 ) {
mouthX = 243;
mouthY = 223;
}
if ( bodyType == 6 && noseType == 1 && mouthType == 1 ) {
mouthX = 243;
mouthY = 232;
}
if ( bodyType == 6 && noseType == 2 && mouthType == 2 ) {
mouthX = 243;
mouthY = 223;
}
if ( bodyType == 6 && noseType == 1 && mouthType == 2 ) {
mouthX = 243;
mouthY = 232;
}
if ( bodyType == 6 && noseType == 2 && mouthType == 3 ) {
mouthX = 243;
mouthY = 223;
}
if ( bodyType == 6 && noseType == 1 && mouthType == 3 ) {
mouthX = 243;
mouthY = 232;
}
if ( bodyType == 6 && noseType == 2 && mouthType == 4 ) {
mouthX = 243;
mouthY = 223;
}
if ( bodyType == 6 && noseType == 1 && mouthType == 4 ) {
mouthX = 243;
mouthY = 232;
}
if ( bodyType == 6 && noseType == 2 && mouthType == 5 ) {
mouthX = 243;
mouthY = 223;
}
if ( bodyType == 6 && noseType == 1 && mouthType == 5 ) {
mouthX = 243;
mouthY = 232;
}
if ( bodyType == 6 && noseType == 2 && mouthType == 6 ) {
mouthX = 243;
mouthY = 223;
}
if ( bodyType == 6 && noseType == 1 && mouthType == 6 ) {
mouthX = 243;
mouthY = 232;
}

// TODO 3: add this if statement (4 lines) to the end of your draw() function
// until we start sending, ask for values
if ( !sending ) {
port.write(65); // arbitrary character (the letter A)
}
}

// TODO 4: copy this whole function into your code (at the end)
// Called whenever there is something available to read
void serialEvent(Serial port) {

sending = true;

// Data from the Serial port is read in serialEvent() using the readStringUntil()
// function with * as the end character.
String input = port.readStringUntil(‘*’);

if (input != null) {
// Print message received
println( “Receiving:” + input);

// The data is split into an array of Strings with a comma or
// asterisk as a delimiter and converted into an array of integers.
int[] vals = int(splitTokens(input, “,*”));

// the num variable will hold the value we’ve read from the serial connection
selectColor = vals[0];

// TODO 5: If you are using more than one sensor, set the other values here. For example:
selectTab = vals[1];
selectAttribute = vals[2];
// etc.
// And just make sure these variables are declared up top (eg, “int otherNum;”)
}

// When finished ask for values again
port.write(65);
}

//Jessy Jo Gomez
//”communication”

int firstSensor = 0; // first analog sensor
int secondSensor = 0; // second analog sensor
int thirdSensor = 0; // third analog sensor
int inByte = 0; // incoming serial byte

void setup()
{
// start serial port at 9600 bps:
Serial.begin(9600);
}

void loop()
{
// if we get a valid byte, read analog ins:
if (Serial.available() > 0) {
// get incoming byte:
inByte = Serial.read();
// read first analog input, divide by 4 to make the range 0-255:
firstSensor = analogRead(3)/4;
// read second analog input, divide by 4 to make the range 0-255:
secondSensor = analogRead(4)/4;
// read third analog input, divide by 4 to make the range 0-255:
thirdSensor = analogRead(5)/4;

// delay 10ms to let the ADC recover:
delay(10);

// send sensor values:
// print each sensor value, then print a comma
Serial.print(firstSensor, DEC);
Serial.print(‘,’);
Serial.print(secondSensor, DEC);
Serial.print(‘,’);
Serial.print(thirdSensor, DEC);

// at the end, send a ‘*’ to end the message:
Serial.print(‘*’);

}
}

comMUSICity

Concept

Through the complexity of the media transition, the ways of people interacting with each other are no longer mutually exchange symbols that are interpreted as being meaningful. So my goal is to develop social engagement through live music. The expected result should bring its audiences who share the same resonance with a certain type of music into an interactive community, stimulate the imagination of users, and allow it’s openness to interpretation.

 Process

IMG_1667副本

/prototype figure1/

2O8A0905副本

/prototype figure2/

IMG_9477

/prototype figure3/

FINAL PROJECT

  • Concept

The topic of my project is “TALK TO ME”.

Contemporary, new kinds of technologies are changing people’s lives constantly. Sometimes we even can’t notice these changes are happening to us. However, technologies can’t really understand people’s emotion need. For instance, the mobile phones and the Internet make distance nothing but can’t make you feel really close to each other.

In this project, I design a sound piece to solve one emotional problem for roommates when they are dissatisfied with each other. You can also use this to give yourself some surprise.

It usually happens in my country that roommates don’t want talk to each other after quarreling and no one want to talk first. It kind of means you surrender if you talk first and really can make you lose face.  We are reactive culture type. We never confront, usually react to others’ actions and must not lose face. But we need to solve problem after quarreling and talk to each other is the only efficient method. How can we make people feel more comfortable to be the first one to talk?

Then I design a sound piece as a bridge to connect people together, initiate conversation. When you are dissatisfied with your roommate, you can use this sound piece to record message to him/her.

  • Function

IMG_3693

There are seven buttons on the wooden box. Because in China we always have six to seven roommates in dorm. Each roommate has one specific button for themselves. The big buttons and little stars combine together to make a letter “t”, which means “Talk to me”. The shape of the box is just like a tree truck and the shape of the edge is just like growth ring, which represents time.

Self-record mode: If you want to leave some message to yourself, you can just click on your button to record messages, then click on your button to save message. The machine can choose a random day from three days to one month. On that day, all the lights will be on and you click on your button to hear the one message from your self, just like a time capsule.

Contact mode: If you want to say something to your roommates but don’t want to knock on their doors or say something face by face, you can click on your button to record message, then click on your roommate’s button to save the message on his/her spot. All the lights will be on immediately to remind your roommates to listen to the message. Only the roommate who you leave message to can hear the message from you. Other roommates can only hear the message from themselves. Through this method, we can avoid the awkward of talking some dissatisfied things face by face and avoid the unpleasant feeling of talking first.

  • Structures and Pieces

I use 7 LED buttons, one NEO pixel ring, one microphone, one speaker with amplifier and one sound chip. It takes me a lot of time to put all these stuff into the wooden box.

IMG_3624 IMG_3626 IMG_3690 IMG_3689 IMG_3688IMG_3628 IMG_3691

  • Code

// include SPI, MP3 and SD libraries
#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>
#include <Adafruit_NeoPixel.h>

// define the pins used
#define RESET 9 // VS1053 reset pin (output)
#define CS 10 // VS1053 chip select pin (output)
#define DCS 8 // VS1053 Data/command select pin (output)
#define CARDCS A0 // Card chip select pin
#define DREQ A1 // VS1053 Data request, ideally an Interrupt pin

#define REC_BUTTON 7
#define PLAY_BUTTON 5

#define PIN 3

Adafruit_VS1053_FilePlayer musicPlayer = Adafruit_VS1053_FilePlayer(RESET, CS, DCS, DREQ, CARDCS);

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

File recording; // the file we will save our recording to
#define RECBUFFSIZE 128 // 64 or 128 bytes.
uint8_t recording_buffer[RECBUFFSIZE];

int led=2;
void setup() {
Serial.begin(9600);
Serial.println(“Record_Play”);

strip.begin();
strip.show();

rainbow(20);

pinMode(led, OUTPUT);

// initialise the music player
if (!musicPlayer.begin()) {
Serial.println(“VS1053 not found”);
while (1); // don’t do anything more
}

musicPlayer.sineTest(0x44, 500); // Make a tone to indicate VS1053 is working

if (!SD.begin(CARDCS)) {
Serial.println(“SD failed, or not present”);
while (1); // don’t do anything more
}
Serial.println(“SD OK!”);

// Set volume for left, right channels. lower numbers == louder volume!
musicPlayer.setVolume(40,40);

// when the button is pressed, record!
pinMode(REC_BUTTON, INPUT);
digitalWrite(REC_BUTTON, HIGH);
pinMode(PLAY_BUTTON, INPUT);
digitalWrite(PLAY_BUTTON, HIGH);

// load plugin from SD card! We’ll use mono 44.1KHz, high quality
if (! musicPlayer.prepareRecordOgg(“v44k1q05.img”)) {
Serial.println(“Couldn’t load plugin!”);
while (1);
}
}

uint8_t isRecording = false;

int num;

void loop() {
if (!isRecording && !digitalRead(REC_BUTTON)) {
Serial.println(“Begin recording”);
isRecording = true;

digitalWrite(led, HIGH);

// Check if the file exists already
char filename[15];
strcpy(filename, “RECORD00.OGG”);
for (uint8_t i = 0; i < 100; i++) {
filename[6] = ‘0’ + i/10;
filename[7] = ‘0’ + i%10;

num=i;
// create if does not exist, do not open existing, write, sync after write
if (! SD.exists(filename)) {
break;
}
}
Serial.print(“Recording to “); Serial.println(filename);
recording = SD.open(filename, FILE_WRITE);
if (! recording) {
Serial.println(“Couldn’t open file to record!”);
while (1);
}
musicPlayer.startRecordOgg(true); // use microphone (for linein, pass in ‘false’)
}
if (isRecording)
saveRecordedData(isRecording);
if (isRecording && !digitalRead(REC_BUTTON)) {
Serial.println(“End recording”);

digitalWrite(led, LOW);

musicPlayer.stopRecordOgg();
isRecording = false;
// flush all the data!
saveRecordedData(isRecording);
// close it up
recording.close();
delay(100);
}

if(!isRecording && !digitalRead(PLAY_BUTTON)){
if (! musicPlayer.begin()) { // initialise the music player
Serial.println(F(“Couldn’t find VS1053, do you have the right pins defined?”));
while (1);
}
Serial.println(F(“VS1053 found”));

SD.begin(CARDCS); // initialise the SD card

// Set volume for left, right channels. lower numbers == louder volume!
musicPlayer.setVolume(40,40);

// Timer interrupts are not suggested, better to use DREQ interrupt!
//musicPlayer.useInterrupt(VS1053_FILEPLAYER_TIMER0_INT); // timer int

// If DREQ is on an interrupt pin (on uno, #2 or #3) we can do background
// audio playing
musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT); // DREQ int

char filename[15];
strcpy(filename, “RECORD00.OGG”);
filename[6] = ‘0’ + num/10;
filename[7] = ‘0’ + num%10;
// Play one file, don’t return until complete

musicPlayer.playFullFile(filename);

// File is playing in the background
if (musicPlayer.stopped()) {
Serial.println(“Done playing music”);
}

delay(100);
}
}

uint16_t saveRecordedData(boolean isrecord) {
uint16_t written = 0;

// read how many words are waiting for us
uint16_t wordswaiting = musicPlayer.recordedWordsWaiting();

// try to process 256 words (512 bytes) at a time, for best speed
while (wordswaiting > 256) {
//Serial.print(“Waiting: “); Serial.println(wordswaiting);
// for example 128 bytes x 4 loops = 512 bytes
for (int x=0; x < 512/RECBUFFSIZE; x++) {
// fill the buffer!
for (uint16_t addr=0; addr < RECBUFFSIZE; addr+=2) {
uint16_t t = musicPlayer.recordedReadWord();
//Serial.println(t, HEX);
recording_buffer[addr] = t >> 8;
recording_buffer[addr+1] = t;
}
if (! recording.write(recording_buffer, RECBUFFSIZE)) {
Serial.print(“Couldn’t write “); Serial.println(RECBUFFSIZE);
while (1);
}
}
// flush 512 bytes at a time
recording.flush();
written += 256;
wordswaiting -= 256;
}

wordswaiting = musicPlayer.recordedWordsWaiting();
if (!isrecord) {
Serial.print(wordswaiting); Serial.println(” remaining”);
// wrapping up the recording!
uint16_t addr = 0;
for (int x=0; x < wordswaiting-1; x++) {
// fill the buffer!
uint16_t t = musicPlayer.recordedReadWord();
recording_buffer[addr] = t >> 8;
recording_buffer[addr+1] = t;
if (addr > RECBUFFSIZE) {
if (! recording.write(recording_buffer, RECBUFFSIZE)) {
Serial.println(“Couldn’t write!”);
while (1);
}
recording.flush();
addr = 0;
}
}
if (addr != 0) {
if (!recording.write(recording_buffer, addr)) {
Serial.println(“Couldn’t write!”); while (1);
}
written += addr;
}
musicPlayer.sciRead(VS1053_SCI_AICTRL3);
if (! (musicPlayer.sciRead(VS1053_SCI_AICTRL3) & _BV(2))) {
recording.write(musicPlayer.recordedReadWord() & 0xFF);
written++;
}
recording.flush();
}

return written;
}
//RING
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}

void rainbow(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256; j++) {
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i+j) & 255));
}
strip.show();
delay(wait);
}
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}

//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, c); //turn every third pixel on
}
strip.show();

delay(wait);

for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
}
}

//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel
for (int q=0; q < 3; q++) {
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, Wheel( (i+j) % 255)); //turn every third pixel on
}
strip.show();

delay(wait);

for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
}
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r – g – b – back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 – WheelPos;
if(WheelPos < 85) {
return strip.Color(255 – WheelPos * 3, 0, WheelPos * 3);
} else if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 – WheelPos * 3);
} else {
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 – WheelPos * 3, 0);
}
}

 

Final Project

Concept

Hacking a CRT monitor for distorting visuals and making glitch effects.

Project by:
Udit Mahajan
Jaskirat Singh Randhawa

Process

We made 2 electromagnets from  carbon steel rods (~7mm) as cores and magnet wires using a drill.

electromagnet1

electromagnet3

 

electromagnet2

We tried the electromagnets on the CRT at different locations and finally settled on this orientation because we found the distortion results quite interesting.

magsinTV

noise

 

Then we made a transistor circuit powered by arduino to control the amount of magnetisation on the electromagnets. The voltage being fed to the electromagnets from the voltage source is being modulated with the help of this circuit.

 

arduino ckt

arduino1

arduino2

arduino3

Then we connected the RCA connector from the TV to a Raspberry Pi to get some video output on screen instead of just noise.

rpi

Code

int ledPin1 = 12;
int ledPin2 = 13;
float fade1 = 0;
float fade2 = 0;
int c = 0;
int d = 10;
int fadeValue=100;
void setup() {
  Serial.begin(9600);
}
void loop() {
  c++;
  d+=5;
    fade1 = 1000*sin(2*PI*fadeValue*c);
    Serial.println(fade1);
    if(fade1>=1){
      digitalWrite(ledPin1, HIGH);
    }else
      digitalWrite(ledPin1, LOW);
    fade2 = 1000*sin(2*PI*fadeValue*2*d);
    if(fade2>=1){
      digitalWrite(ledPin2, HIGH);
    }else
      digitalWrite(ledPin2, LOW);
     Serial.println(fade2);
    delay(1000);
}

Final Project

ThesisFinalKeynote09.001

CONCEPT

My thesis is inspired by my personal experiences witnessing and taking care of my mother for years as she has been going through a tedious physical rehabilitation plan after an injury that has made her bedridden. Through the process, I have realized that more so than usual, physical rehabilitation requires constant action. If we where to think of this as an algorithm, time always works against you and deconstructs what you have been working so hard on constructing.

Deconstruction > Construction is a telerehabilitation aid with sculptural qualities that helps outpatients in isolation better cope with and stay consistent with their physical rehabilitation plans.

Conceptually this piece brings up questions about motivation and self-efficacy, how medical devices have traditionally been designed with aesthetics and empathy secondary to functionality, and how that relates to psychology and wellbeing.

When speaking to healthcare practitioners, proper form, time interval and motivation to do the exercises in the first place is the most common problem. Over 18 million people have immobility issues, making them the second largest minority, and almost 40% of people aged over 65 have some sort of immobility issue. This is the fastest growing segment of the American population, expected to double in the year 2050. Most common conditions causing disability: arthritis, rheumatism, stroke and spinal cord injuries. 11,000 people sustain a spinal cord injury every year, and 88% are rehabilitating in the home, and only about half are getting health insurance. So we can evidently see how struggling to rehabilitate in isolation in the home becomes a problem at a greater scale.

PRECEDENTS

ThesisFinalKeynote09.005

Lygia Clark has served as an inspiration in terms of her psychotherapeutic methodologies using art as a vehicle to connect the body and mind.

Thad Starner’s Mobile Music Touch is a step forward in taking advantage of the brains ability to heal quicker through passive haptic feedback in combination with visual queues.

Current telerehabilitation devices are exceedingly focused on screen based interaction and are typically big and aesthetically unpleasing. Moreover, they only tackle one muscle group at a time.

There is a clear lack of telerehabilitation and exercise aids that are small, aesthetically pleasing and can help cater to more than one are of the body. Hence, my prototype below aimed to explore how this one object can be functional in multiple ways. 

PROCESS

This class has provided me to work on my physical computing skills to be able to build the foundation for a product that is able to help with these issues. This semester I have mainly focused on functionality, and below are the results of my final prototype for this phase.

My aim is to bring this prototype to the rehabilitation clinic where my mother currently resides, in order to nail down the functionality and test the experience with my target user over a longer period of time. This would allow me to start next semester by working on form and how I can incorporate more sculptural qualities.

By incorporating an accelerometer, and giving the user visual feedback through LED’s, the user can know how to hold proper form. Moreover, haptic feedback lets the user know if they have done their sets within the right time frame.  This time, vibrations where used only when the user needed to improve (see code below).

Functionality

– Range of motion exercises using an infrared proximity sensor.

– Arduino Yun to collect data online through socket connections and Mongo DB.

Triple axis accelerometer for tracking the form and giving the user visual feedback.

– Vibration motor and LED’s for output.

Qi charger and receiver for wireless charging with a Lipo charger and 3.7V 1200 mAh battery.

I saw this as an exercise in 3D modeling, and tried several different designs in different programs before landing on my final simplified version. As expected, 3D printing is a tedious process, and I learnt a lot in terms of how to fabricate with the right thickness as well as which software to use. I found Maya to be an awful program to work with, and finally settled on Blender. I am happy I went through all this as I plan to add kinetic movement in my design next semester, and will probably need smaller custom parts printed.

Screen Shot 2014-11-28 at 5.06.11 PM

makerbot

Screen Shot 2014-12-12 at 4.07.21 PM

I soldered all the connections on to a shield for stability. I would have made my own circuit, but needed to use the Arduino Yun anyway for the online connection.

Screen Shot 2014-12-12 at 4.06.25 PM

If you ever decide to get this wireless Qi receiver, be very careful as you solder the wires as it is extremely fragile. Below, you can see how one of the plates fell off when moving the wires a bit, probably because of a little too much heat.

Screen Shot 2014-12-12 at 4.12.34 PM

In order to test if the weight would fluctuate with the use of angular momentum, precise measurements where crucial. I had to take several trips to the metal shop and use some new tools to polish the surfaces for a flat measuring area and balanced surface.

Screen Shot 2014-12-12 at 4.07.00 PM

Screen Shot 2014-12-12 at 4.06.43 PM

Below I am pushing the data to the server through socket connections with node.js.

Screen Shot 2014-12-12 at 3.20.08 AM

————————————————————————————-

Arduino Code:

#include <Bridge.h>
#include <YunClient.h>

YunClient client;
float distance;

#define SERVER_ADDRESS “10.0.1.13”
#define SERVER_PORT 5000

unsigned long postingInterval = 50; //delay between server updates
unsigned long lastPost = 0; // when you last made a request
unsigned long currTime = 0; //what time is it right now

String incomingDataString = “”; //this will hold raw incoming data string
boolean serverResponded = false;

// Accelorometer
const int groundpin = 18; // analog input pin 4 — ground
const int powerpin = 19; // analog input pin 5 — voltage
const int xpin = A3; // x-axis of the accelerometer
const int ypin = A2; // y-axis
const int zpin = A1; // z-axis (only on 3-axis models)
int yVal = 0;

//Distance sensor
int IRpin = A4;
int IRVal = 0;

//Vib Motor
int vibration = 11;

//LED’s
int ledPin = 9;
int ledPin2 = 10;
int ledPin4 = 6;
int ledPin6 = 5;

//Counter
int counter = 0;
int timer;
int startTime;
int endTime;
int trainTime;

//Data sent only if true
bool sent = false;
bool sentRom = false;

bool UPcurl = false;
bool DOWNcurl = false;

void setup() {
pinMode(vibration, OUTPUT);
pinMode(groundpin, OUTPUT);
pinMode(powerpin, OUTPUT);
digitalWrite(groundpin, LOW);
digitalWrite(powerpin, HIGH);
Serial.begin(9600);
pinMode(ledPin, OUTPUT);

Bridge.begin();
Console.begin();

client.connect(SERVER_ADDRESS, SERVER_PORT);
}

int count = 0;
int upCurl = 0;
int rom = 0;

void loop() {

Console.print(“yVal: “);
Console.print(yVal);
Console.print(“\t”);
Console.print(“distance: “);
Console.print(distance);
Console.print(“\t”);
Console.print(counter);
yVal = analogRead(ypin);

if (yVal > 490) {
DOWNcurl = true;
} else
{
DOWNcurl = false;
}

if (yVal < 360) {
upCurl = 1;
UPcurl = true;
if (client.connected() && sent == false) {
client.print(1);
sent = true;
}

} else {
upCurl = 0;

UPcurl = false;
sent = false;
}

if (UPcurl == true) {
if (counter == 0) {
startTime = millis();
}

counter = counter + 1;

if (counter > 9) {
analyze();
counter = 0;
}
analogWrite(ledPin, 255);
analogWrite(ledPin2, 255);
analogWrite(ledPin4, 255);
analogWrite(ledPin6, 255);
delay(500);
analogWrite(ledPin, 0);
analogWrite(ledPin2, 0);
analogWrite(ledPin4, 0);
analogWrite(ledPin6, 0);
}

if (DOWNcurl == true) {
analogWrite(ledPin, 255);
analogWrite(ledPin2, 255);
analogWrite(ledPin4, 255);
analogWrite(ledPin6, 255);
delay(500);
analogWrite(ledPin, 0);
analogWrite(ledPin2, 0);
analogWrite(ledPin4, 0);
analogWrite(ledPin6, 0);
}

// Distance calculation
float volts = analogRead(IRpin) * 0.0048828125;
distance = 65 * pow(volts, -1.10);

if (distance > 25 && distance < 35) {
rom = 1;
if (client.connected() && sentRom == false) {
client.print(2);
sentRom = true;
}
if (counter == 0) {
startTime = millis();
}
Serial.println(counter);
counter = counter + 1;

analogWrite(ledPin, 255);
analogWrite(ledPin2, 255);
analogWrite(ledPin4, 255);
analogWrite(ledPin6, 255);
//delay(500);

} else {
rom = 0;
sentRom = false;

analogWrite(ledPin, 0);
analogWrite(ledPin2, 0);
analogWrite(ledPin4, 0);
analogWrite(ledPin6, 0);
}

//check if it’s time to post an update to the server
currTime = millis();

if (currTime – lastPost >= postingInterval) {
if (client.connected()) {
String data = String(upCurl) + “,” + String(rom) + “\n”;
count++;
} else {
//no connection, try to make one again:
Console.println(“\nattempting to connect to server”);
client.connect(SERVER_ADDRESS, SERVER_PORT);
delay(2000); //delay 2 seconds before trying another server reconnect
}
lastPost = currTime;
}

if (serverResponded) {
Console.print(“received from server: “);
Console.println(incomingDataString);
incomingDataString = “”; //clear out our data string for next server message
serverResponded = false; //start this at false after server request
}
}

void motor(int valueLong) {
digitalWrite(vibration, HIGH);
delay(valueLong);
digitalWrite(vibration, LOW);
}

void analyze() {
endTime = millis();
trainTime = endTime – startTime;

// IF YOU DID THE EXERCISES TOO FAST, GIVE A LOONG VIBRATION TO TELL YOU TO SLOW DOWN
if (trainTime <= 13000) {
motor(3000);
}

// IF YOU DID THE EXERCISES TOO SLOWLY, GIVE A SHORT VIBRATION TO TELL YOU TO SPEED UP
if (trainTime > 25000) {
motor(500);
}
}

————————————————————————————-

For the future, I plan to build a communication platform that can be used with physical therapists in order to facilitate the monitoring of progress with patients. This platform will also be used to calibrate the device. First steps include pushing the data online, which I have done here.

One of the ways in which more functionality could be added was to use angular momentum in order to fluctuate the weight. However, this is much more difficult in practice than in theory. After have done multiple tests, I realized that in order to make the resistance high enough, you will need a strong and quick stop. This is difficult to achieve without custom high quality mechanics, as the nature of stopping such a strong force needs an even stronger resistance. The example below is a good demonstration of this.

Moreover, the vibrations that built up was difficult to control, even though I measured it as precise as I could, and built a custom holding. In order to minimize the friction and get as little resistance as possible (and so also vibration) you would need to use custom spring loaded ball bearings. Using angular momentum to fluctuate a weight is theoretically possible, but not with the resources we have here at school – unfortunately. Nevertheless, this could serve as a proof of concept for further explorations, and has been a good learning experience.

Final Project _ Qianjing Liu

2O8A09412O8A09412O8A0941

My new concept is making a device to express how noise affect our inner world.  The container is divided into two parts. One stand for our inner wold while the other one means the outside world. Since people can hardly concentrate on both the inner world and the outside world,  they have to struggle for more space.  Once the outside part got more room, it means the inner part has lost some.

When people stay in a noisy environment, they can hardly focus on their thought. Instead of thinking in their mind, they will pay more attention what is happening around. So I try to make the two parts of room available, and could change with the volume of sound.

To get the volume I used a sound sensor. And I used two servos to get a border, which divided the container into two parts,  moving with the change of environment. To make the loudness of  sound more visible, I use two fans, which could also map their speed with noisy environment. There are small feathers inside the container, so that they will fly in the container while it is noisy outside.

 

#include <Servo.h>
int sensor1=11;
int sensor2 =10;
int sensor3 =12;
int pos1=0;
int pos2;
int sensor = A5;
int loudness;

Servo myservo1;
Servo myservo2;

void setup(){
pinMode(sensor1,OUTPUT);
pinMode(sensor2,OUTPUT);
pinMode(sensor3,OUTPUT);
Serial.begin(9600);
pinMode(sensor,INPUT);
myservo1.attach(6);
myservo2.attach(9);
}

void loop(){
loudness = analogRead(sensor);
loudness = loudness -500;
if(loudness < 0){
loudness = 0-loudness;
}
if (loudness >=430){
analogWrite(sensor1,255);
analogWrite(sensor2,255);
digitalWrite(sensor3,HIGH);
if(pos1 < 75){
pos1++;
delay(15);
}
}
if (loudness <430){
analogWrite(sensor1,0);
analogWrite(sensor2,0);
digitalWrite(sensor3,LOW);
if(pos1 > 0){
pos1–;
delay(15);
}
}

pos2=180-pos1;
myservo1.write(pos1); // tell servo to go to position in variable ‘pos’
myservo2.write(pos2);
Serial.println(loudness);
}

FINAL PROJECT “TAPPING SOUNDs”

IMG_2249

“Tap dance is a form of dance characterized by using the sounds of tap shoes striking the floor as a form of percussion. Two major variations on tap dance exist: rhythm (jazz) tap and Broadway tap. Broadway tap focuses on dance; it is widely performed in musical theater. Rhythm tap focuses on musicality, and practitioners consider themselves to be a part of the Jazz tradition”. http://en.wikipedia.org/wiki/Tap_dance

Tap Dance is every where you go, I design this shoes as one kind of music which is using tap sound. This shoes create another tone of sound. The concept is still making sound by tapping but more softly and users are tapping on the heel and toe just a little bit. This prototype is not necessary create the tap sound but can be any kind of sound and can add more pitches sound.

In the future, this shoes will be able to record the sound while people are tapping. Also the sound can hear just the player by using head phone. People can crate they own rhythm everywhere. This music device can put on any shoes.

 

CODE :

#include “pitches.h”

int analogpin[6]={A0,A1,A2,A3};

int buzpin=8;

int threshold=70;

void setup()

{

Serial.begin(9600);

}

void loop()

{

if(analogRead(analogpin[0])>threshold)

{

Serial.println(“A0”);

tone(8, NOTE_B4,1000/4);

}

if (analogRead(analogpin[1])>threshold)

{

Serial.println(“A1”);

tone(8, NOTE_A6,1000/4);

}

if (analogRead(analogpin[2])>threshold)

{

Serial.println(“A2”);

tone(8, NOTE_F4 ,1000/6);

}

if (analogRead(analogpin[3])>threshold)

{

Serial.println(“A3”);

tone(8, NOTE_E6,1000/6);

}

if (analogRead(analogpin[4])>threshold)

{

if (analogRead(analogpin[5])>threshold)

{

}

http://garagelab.com/profiles/blogs/projeto-piezoelectric-arduino-drum

Final_musicGarden

IMG_6013IMG_6001

At the beginning, I wanted to design an MIDI glove that could adapt people’s natural way for playing music.

I often tap my fingers on my leg following the beat/rhythm when I enjoy music on the subway. It’s not only my personal habit, it’s a common behavior. I want to design some instrument can adapt to this behavior. Besides, the fingers are agile enough for playing complicated music. That’s why I choose a glove for adapting people’s natural way for playing music.

Music is relaxing for me. I just want to sit in such a place, somewhere like a garden, or a place full of nature, for enjoying some chill music, wasting my whole day without feeling guilty.

333333

 

That’s why I came up with the concept of MUSIC GARDEN.

This piece is for my major studio.

IMG_5807

But when I finished and played, I found although it was easier to generate sounds than keyboard, it was hard to create music, as creating needed inspiration and coincidence (I believe). I could hardly break the music patten I have done, as I’ve gotten used to the sequence of tapping fingers. I just wondered whether I could design some instruments which was not only easy to use, but also could provide inspirations. So I designed another instrument.

As the natural way for playing music was not that helpful, I wanted to use an ironic way to design the new instrument. What is the life resource of a garden or plant? That’s light. So I want to use this“natural” way for playing.

When I play with this, I can create some unexpected music which is more satisfying.

I have chosen Future Instrument as my Collab next semester. I will think about the instruments in this direction, which is not only for usability and accessibility, but also for helping break the habit of creating, and for more playful enjoyments.

Some documentation of design process.

pcompFinal2_bbIMG_5944 IMG_5955 IMG_5956 IMG_5969IMG_5962 IMG_5976

 

Code for MusicGarden,

int note = 0;
int hitavg = 0;
int dtcolor = 0;
int led = 12;
char pinAssignments[] ={‘A0’, ‘A1’, ‘A2’, ‘A3’, ‘A4’, ‘A5’};
byte PadNote[] = {58, 57, 55, 53, 50};

void setup()
{
Serial.begin(57600); // Default speed of the Serial to MIDI Converter serial port
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
pinMode(A3, INPUT);
pinMode(A4, INPUT);
pinMode(A5, INPUT);

}

void loop(){

for(int pin=0; pin < 5; pin++){

hitavg = analogRead(pin);
// Serial.println(hitavg);

dtcolor = analogRead(A5);
Serial.println(dtcolor);

//sense the color
if(dtcolor < 300){
if(hitavg > 300){
MIDI_TX(144,PadNote[pin] -5,127); // NOTE ON
delay(100);
MIDI_TX(128,PadNote[pin]-5 ,127); // NOTE OFF
delay(100);
}
}

if(dtcolor > 300){
if(hitavg > 300){
MIDI_TX(144,PadNote[pin], 127); // NOTE ON
delay(100);
MIDI_TX(128,PadNote[pin], 127); // NOTE OFF
delay(100);
}
}

}
}

void MIDI_TX(unsigned char MESSAGE, unsigned char PITCH, unsigned char VELOCITY)
{
Serial.write(MESSAGE);
Serial.write(PITCH);
Serial.write(VELOCITY);
}

Final Proposal Enrica and Roula

For the final proposal me and Roula decided to keep working on the concept we started for Midterm. We are interested in building an object that act like a human and in stopping the idea that machine have to be only assertive and nice to us.

Click on the image, it’s a GIF

.robot 2

So our object will be so emotionally connected to us that will be lovely and calm when we are around it, but can be very very very pissed if we leave it alone, by itself, like a normal object. If he gets pissed then it will start sending email to show its emotions. For Midterm we have been able to make it send pre-coded messages, but the result, even if very funny, was limited. For the Final we want to make it pull messages from Twitter and directly send them to you.

 

New proposal for Final

How will people feel in a noisy environment?

In my opinion, it is hard to focus on what you are doing when it is noisy. So I think there is a conflict between your inner world and the outside world.

The inner world may on behalf of your thought and the outside world is how you feel physically. When it is quiet, people is easy to sink their own world and get a deep think. But the noisy environment push people to feel the outside world instead of concentrate on their thought.

I am going to divide a certain space into two parts. One present our inner world while the other one means the outside world. Since the space is certain, the two parts are going to strive for a larger room. If the environment is noisy, the part for outside will become bigger, while the inner part will become smaller and vice versa.