ICM Final
I wanted to use images and particles to morph on image into the other. I did this by importing images and then creating a particle system which moved one image to the next.
Here is the code for this project
Archive for the ‘ Fall 2009 ’ Category
I wanted to use images and particles to morph on image into the other. I did this by importing images and then creating a particle system which moved one image to the next.
Here is the code for this project
The helper is an assistive technology for a person with muscular dystrophy who can not pinch. It is composed of an arm and a controller. The controller is composed of 2 round objects the control the arm sided to side and around itself. The controller has 2 buttons one to open and close the grabber and a preset button that will bring the arm to bring object to the user.

The grabber mechanism motion is very similar to a fun childhood game hungry hungry hippos.


The controller was designed to be anbidextrous.

We installed buttons to allow for preset commands such as "Bring it to me" and "Grab item"

This is before the controller was wired in to the breadboard and arduino. We used big buttons to make it easier for the user who lack dexterity to push them.

The helper is controlled by two 360 potentiometer and two lighted big buttons.

Russ started with a cardboard mock up of how the grabber will operate.

Parts are in for the Grabber and Servo for the Arm.

The original design for the grabber the gears went on the outside, then mount for gear, then the axel. This did not let the axel spin 360 degrees.

We kept the main box clear any obstructions down to the rivets in order to have smooth movement for the Grabber.

This is the interim design that the grabber had. We mounted the axel on the inside which let the axel rotate 360 degrees.

This is the side view of the interim design for the grabber.
We initially tested the arm to see how the servo would react to the weight of the servo.

The required torque power for mounting to the rear of the Grabber was to great for our servo. We cut down the lifting force by mounting the arm closer to the center of the Grabber box.

In order for us to mount the arm in the center, we had to redesign the Grabber box to include a roof.

One stumbling block that we found was the Grabber was binding if drove it from only one side. We had to run a drive shaft to the other side so that they wheels rotated equally.

Quick test to see if the servo can lift the Grabber from it's new mounting point.

Originally we mounted the arm directly to servo. This put to much stress on center screw on the servo and flexed to much.

The new servo turret takes the stress off the servo but allows the servo to rotate the grabber.

This is the final version of the grabber. We are using a motor to drive the Grabber motion.

We are using springs to lift the Grabber above the items it intends to grab.

Russ making sure everything works.
Pcomp Final – The Helper from Zeven Rodriguez on Vimeo.
CODE
#include
int analogPin0 = 0; // blue up and down
int analogPin1 = 1; // green left right pot
int analogPin2 = 2; // blue pot to control hbridge speed
// pins for buttons
int redButton = 2; // red wire to pin 2
int greenButton = 5; // green wire to pin 5
// pins for lights
int redLight = 10; // yellow wire to pin 10
int greenLight = 11; // white wire to pin 11
// pins for motors
int servo1 = 6; // no color yet left right
int servo2 = 7; // no color yet up down
int motor1 = 9; // pulse pin for the hbridge
int red = 0;
int green = 0;
int analogSensorPin = 0; // select the input pin for the potentiometer
int analogSensorPin1 = 1; // select the input pin for the potentiometer
int formerValue = 0;
int nowValue = 0;
float difference = 0;
float deg = 83;
int formerValue1 = 0;
int nowValue1 = 0;
float difference1 = 0;
float deg1 = 0;
Servo updown;
Servo leftright;
void setup() {
Serial.begin(9600);
updown.attach(8);
leftright.attach(7);
pinMode(redButton, INPUT);
pinMode(greenButton,INPUT);
}
void loop()
{
// read the value from the sensor:
// this reads pot 1
nowValue = analogRead(analogSensorPin);
//Serial.print(“this is pot”);
//Serial.println(nowValue);
difference = nowValue – formerValue;
if(abs(difference) > 500)
{
if(difference > 0)
{
difference = formerValue + (1023 – nowValue);
}
else
{
difference = (1023 – formerValue) + nowValue;
}
}
deg += difference / 30;
if(deg < 0) { deg = 0; } else if(deg > 180)
{
deg = 180;
}
// Serial.println(deg);
formerValue = nowValue;
// this reads pot 2
nowValue1 = analogRead(analogSensorPin1);
//Serial.print(“this is pot1″);
//Serial.println(nowValue1);
difference1 = nowValue1 – formerValue1;
if(abs(difference1) > 500)
{
if(difference1 > 0)
{
difference1 = formerValue1 + (1023 – nowValue1);
}
else
{
difference1 = (1023 – formerValue1) + nowValue1;
}
}
deg1 += difference1 / 30;
if(deg1 < 0) { deg1 = 0; } else if(deg1 > 180)
{
deg1 = 180;
}
// Serial.println(deg1);
formerValue = nowValue;
updown.write(deg);
Serial.println(deg);
leftright.write(deg1);
red = digitalRead(redButton);
//Serial.print(“this is the red button”);
//Serial.println(red);
green = digitalRead(greenButton);
//Serial.print(“this is the red button”);
//Serial.println(red);
}
The Helper is a assitive technology robot. The purpose of the robot is to be able to pick up and reach objects for individuals in wheel chairs. The project is composed of 2 parts one is the Helper robot that is able to reach and grab the objects. The other is the control unit. One of the main design concerns for the control unit is that a lot of people of handicap cannot pinch. For this reason the orb works with large objects that rotate like a pot to control the robot.

This week we delt with tranistors and HBridge. The transistor help to control motors, lights, or objects that have a higher voltage that the Arduino cannot power. The Transistor has a Base, Collector, and Emitter. The base goes from a pin of the arduino. This acts like a switch for the object you are controlling. The collector, which is the middle pin, goes to ground. The Emitter, the last pin left to right, takes the ground of a motor in this case. The power to the motor comes from the power source that correlates to the voltage of the motor. In this case, we are taking power from the Vin pin. There is a diode that crosses from the Collector to the Emitter. The silver edge goes to the collector. It helps especially with motors because when they spin down they still are making energy.

This code is to program the arduino to speed up and slow done the motor.
const int potPin = 0; // Analog in 0 connected to the potentiometer const int transistorPin = 9; // connected to the base of the transistor int potValue = 0; // value returned from the potentiometer void setup() { // set the transistor pin as output: pinMode(transistorPin, OUTPUT); } void loop() { // read the potentiometer, convert it to 0 - 255: potValue = analogRead(potPin) / 4; // use that to control the transistor: analogWrite(9, potValue); }
Physcomp Lab8 – Transistor from Zeven Rodriguez on Vimeo.
Now to the HBridge Lab. The HBridge is used to control multiple actions. In this case we are reversing the direction of a DC motor. This is how the HBridge wiring looks like.
This is my wiring.

Here is the code to get the HBridge to work. This code uses a pot to control the speed and a switch to reverse the direction. If you remove the analogWrite code, it will just work with the switch.
const int switchPin = 2; // switch input
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin
const int ledPin = 13; // LED
int pot= 0;
int potValue = 0;
void setup() {
Serial.begin(9600);
// set the switch as an input:
pinMode(switchPin, INPUT);
// set all the other pins you’re using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
pinMode(ledPin, OUTPUT);
// set enablePin high so that motor can turn on:
//digitalWrite(enablePin, HIGH);
// blink the LED 3 times. This should happen only once.
// if you see the LED blink three times, it means that the module
// reset itself,. probably because the motor caused a brownout
// or a short.
blink(ledPin, 3, 100);
}
void loop() {
potValue = analogRead(pot);
Serial.println(potValue);
// if the switch is high, motor will turn on one direction:
if (digitalRead(switchPin) == HIGH) {
analogWrite(enablePin, potValue/4);
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
}
// if the switch is low, motor will turn in the other direction:
else {
analogWrite(enablePin, potValue/4);
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
}
}
/*
blinks an LED
*/
void blink(int whatPin, int howManyTimes, int milliSecs) {
int i = 0;
for ( i = 0; i < howManyTimes; i++) {
digitalWrite(whatPin, HIGH);
delay(milliSecs/2);
digitalWrite(whatPin, LOW);
delay(milliSecs/2);
}
}
Phsycomp Lab8 – HBridge with Pot from Zeven Rodriguez on Vimeo.

For our physical computing midterm Julio Terra, Michael Martinez-Campos, and Myself created a MIDI based light table. We used LEDs in a gradient pattern and a puck like object with photocells to achieve this. The photocells pick up the brightness from the LEDs. The Photocells are connected to the Arduino. Through Processing and using the OSC library we turn the photocell values into MIDI. The light has 2 sets of lights, green and red. Each of cell is composed of a red and green light. The cells provide 2 discrete values that affect the MIDI values that go to the music software. The MIDI information could then be used by many music software. In our case we chose Ableton. This article mostly focuses on the making of the light table.
Physcomp Midterm – MIDI Light Table from Zeven Rodriguez on Vimeo.
One day while looking around the shop, I found this cardboard grid. The cardboard grid needed stiffening. Hot glue and a simple wood frame were used. This piece we meant only as a sketch but it seemed to be of great use in the prototype.

We decided to use foil to help with the diffusion of light.

After soldering the 50 LEDs, we wired the rows of lights in parallel. This made it easy to make sure which lights were not working.

We decided to limit the puck object to get a better reading off the LEDs. Initially, we used a wood track to guide the movement of the puck.
The wooden block between the tracks contains bearings which help guide the wood easier along the tracks.

We used a resistor ladder to control the brightness of the lights.

Due to the high friction and the lack of rigidity of wood, metal was used to fix this issue.

This was the first time we started testing the brightness of the LEDs and the readings from the photocells.

We decided to use 2 photocells per cell because after trying one per cell we were getting better readings.

After the first test, we realized that we needed further diffusion of the light. After a chat with our professor, Tom Igoe he suggested some vellum for this purpose.
The biggest challenge for use was to get the maximum output from the LEDs as possible. We learned that pots could help use vary the resistance of the voltage to get a range of LEDs. This was better then the resistance ladder because it was easier to set. We originally used 10k pots but there was not enough control. We ended up using 1k pots. After using a 5v voltage regulator, we achieved around 2.3 volts on the brightest row of LEDs.

After testing, we found that our readings were difficult to map. To help achieve a better reading we decided to put in a push button to only pick up values when you pressed it. We also added a dome and a slit to put in a scroll-like wheel(which is actually a pot) to control volume.

Here are Julio and Mike doing some testing and calibration.

This is the final pot ladder for the lights.

This is was the lights looked like when they were tuned.

Our puck turned out to be a cool little mascot

In the end, the thing we learned most about this project is the amount of testing it really takes for something like this to work. Because of the photocells prefer something with a higher contrast, the table did not work out perfectly. For more information about the programming aspects of this project visit Julio Terra’s blog
For my ICM midterm project I want the user to choose a series of of websites that they identify with and using rss feeds compose a text-ural representation of themselves. To view the actual processing app and code visit: http://www.zevenrodriguez.com/itp/icm/midterm/
This would be the first prompt

After to press start it should either take a video capture or a image of you and create the display below

For this lab we were doing more advanced serial communication with the arduino and processing. I used 2 pins of an accelerometer and a pot. The hardest part of this lab is the handshaking aspect. The reason it is tricky is because the different types, punctuation and handshaking. The handshaking makes sure that the information does not get backed up in the buffer.
This arduino code sends the information in this format 0,0,0. The punctuation method would just be the code with out this function establishContact(); and this if(Serial.available()>0) . With these 2 parts, we establish the handshake method between the arduino and processing. When the “hello” is sent from the arduino code, the processing code picks it up and sends back a character. This enables processing to get information when it needs it.
Arduino Code
int analogOne = 0; // analog input
int analogTwo = 1; // analog input
int analogThree = 2; // digital input
int sensorValue = 0; // reading from the sensor
void setup() {
// configure the serial connection:
Serial.begin(9600);
// configure the digital input:
// pinMode(digitalOne, INPUT);
establishContact();
}
void loop() {
if(Serial.available()>0){
// read the sensor:
sensorValue = analogRead(analogOne);
// print the results:
Serial.print(sensorValue, DEC);
Serial.print(“,”);
// read the sensor:
sensorValue = analogRead(analogTwo);
// print the results:
Serial.print(sensorValue, DEC);
Serial.print(“,”);
// read the sensor:
sensorValue = analogRead(analogThree);
// print the last sensor value with a println() so that
// each set of four readings prints on a line by itself:
Serial.println(sensorValue, DEC);
}
}
void establishContact() {
while (Serial.available() <= 0) {
Serial.println(“hello”); // send a starting message
delay(300);
}
}
Processing Code
import processing.serial.*; // import the Processing serial library
Serial myPort; // The serial port
float bgcolor; // Background color
float fgcolor; // Fill color
float xpos, ypos; // Starting position of the ball
boolean firstContact = false; // Whether we’ve heard from the microcontroller
void setup() {
size(640,480);
background(255);
smooth();
// List all the available serial ports
println(Serial.list());
// I know that the first port in the serial list on my mac
// is always my Arduino module, so I open Serial.list()[0].
// Change the 0 to the appropriate number of the serial port
// that your microcontroller is attached to.
myPort = new Serial(this, Serial.list()[0], 9600);
// read bytes into a buffer until you get a linefeed (ASCII 10):
myPort.bufferUntil(‘\n’);
}
void draw() {
fill(random(255),fgcolor,random(255), random(255));
noStroke();
// Draw the shape
ellipse(xpos, ypos, 100, 100);
}
// serialEvent method is run automatically by the Processing applet
// whenever the buffer reaches the byte value set in the bufferUntil()
// method in the setup():
void serialEvent(Serial myPort) {
// read the serial buffer:
String myString = myPort.readStringUntil(‘\n’);
// if you got any bytes other than the linefeed:
if (myString != null) {
myString = trim(myString);
if (firstContact == false) {
if (myString.equals(“hello”)) {
myPort.clear(); // clear the serial port buffer
firstContact = true; // you’ve had first contact from the microcontroller
myPort.write(‘A’); // ask for more
}
}
else{
// split the string at the commas
// and convert the sections into integers:
int sensors[] = int(split(myString, ‘,’));
// print out the values you got:
for (int sensorNum = 0; sensorNum < sensors.length; sensorNum++) {
print(“Sensor ” + sensorNum + “: ” + sensors[sensorNum] + “\t”);
}
// add a linefeed after all the sensor values are printed:
println();
if (sensors.length > 1) {
xpos = map(sensors[0], 0,400,0,width/2);
ypos = map(sensors[1], 0,400,0,height/2);
fgcolor = sensors[2] / 4;
}
}
myPort.write(“A”);
}
}
Observation. Pick a piece of interactive technology in public, used by multiple people. Write down your assumptions as to how it’s used, and describe the context in which it’s being used. Watch people use it, preferably without them knowing they’re being observed. Take notes on how they use it, what they do differently, what appear to be the difficulties, what appear to be the easiest parts. Record what takes the longest, what takes the least amount of time, and how long the whole transaction takes. Consider how the readings from Norman and Crawford reflect on what you see.

Reaction
The piece of technology I chose was a very simple low tech water purifier that had a short life span on the ITP floor. The technology is called the Brita filter. At first, the Brita filter seems to be designed nicely. Its has a very round shape and its white which makes it seem clean and streamline. This I think is the biggest flaw with the Brita filter. It took me a second to figure out how to switch between purified water and tap water. The knob was tough to grab if your hands get wet and the knob seemed to spin continuously. The nail on the coffin for the Brita filter was when I observed some people not realizing that they were washing dishes with the filtered water. I think this happened because people are not invested in the technology. People tend to take for granted that things happen automatically.
I think the biggest problems with the Brita filter could be fixed some what easily. First would be a more visual indicator that you are using purified water (even if they come out of different orifices). The second would be a larger lever as the switch. The Brita filter helps with using countless water bottles. If you do not make it able to become second nature then the technology fails. Sadly, the filter is now gone.
Using Serial Communication with Arduino and Processing was not too bad.
The arduino code is simple. We are using a Pot put in pin0 and doing a basic analogread. The import things about this whole lab is that you make sure you always close the serial monitor, because only one application could read the serial stream.
int analogPin = 0; int analogValue = 0; void setup() { // start serial port at 9600 bps: Serial.begin(9600); } void loop() { // read analog input, divide by 4 to make the range 0-255: analogValue = analogRead(analogPin); analogValue = analogValue / 4; Serial.print(analogValue, BYTE); // pause for 10 milliseconds: delay(10); }
Once you upload close the Arduino application. So you avoid any serial issues. Open processing. I simply altered some code and made a sort of paint brush. Here is the code.
import processing.serial.*;
Serial myPort; // The serial port
int graphXPos = 1; // the horizontal position of the graph:
float randNum = 0;
void setup () {
size(640, 480); // window size
// List all the available serial ports
println(Serial.list());
// I know that the fisrt port in the serial list on my mac
// is usually my Arduino module, so I open Serial.list()[0].
// Open whatever port is the one you’re using.
myPort = new Serial(this, Serial.list()[0], 9600);
// set inital background:
background(255);
smooth();
}
void draw () {
// nothing happens in draw. It all happens in SerialEvent()
}
void serialEvent (Serial myPort) {
// get the byte:
int inByte = myPort.read();
randNum = random(255);
// print it:
println(inByte);
// set the drawing color. Pick a pretty color:
fill(randNum, randNum);
noStroke();
// draw the ellipse:
ellipse(graphXPos, inByte*2, 100, 100);
// at the edge of the screen, go back to the beginning:
if (graphXPos >= width) {
graphXPos = 0;
}
else {
// increment the horizontal position for the next reading:
graphXPos++;
}
}
Physcomp Lab6 – Serial Communication from Zeven Rodriguez on Vimeo.
This project was using Simplml and Processing to pull in the netflix top 100 and takes all of the titles and counts the amount of a specific letter there are in the titles. The image below shows the graphic representation of this. There are 26 boxes. The darker the box the lest amount of letters there are. The issue I current have is figuring out how to use PFont with objects.

Here is the code
import simpleML.*;
letter[] table = new letter[26];
char[] rssTemp;
int rssLength = 0;
String[] headlines;
String headlinesTemp;
int row = 0;
int modInterval = 6;
int modNumber = 0;
int[] letterAmount = new int[26];
PFont f;
int letterPosX = 0;
int letterPosY = 0;
void setup(){
size(635,480);
smooth();
background(255);
f = createFont( ” Arial ” ,3,true); // Loading font
for(int i = 0; i
if(i < 6){ row = 0; table[i] = new letter( i , row ,106,96); } if((i >=6) && (i<12)){ row = 96; modNumber = i%modInterval; table[i] = new letter( modNumber , row ,106,96); } if((i >=12) && (i<18)){ row = 192; modNumber = i%modInterval; table[i] = new letter( modNumber , row ,106,96); } if((i >=18) && (i<24)){ row = 288; modNumber = i%modInterval; table[i] = new letter( modNumber , row ,106,96); } if(i>=24){
row = 384;
modNumber = i%modInterval;
table[i] = new letter( modNumber , row ,106,96);
}
}
//end of array parsing
XMLRequest xreq = new XMLRequest(this,”http://rss.netflix.com/Top100RSS”);
xreq.makeRequest();
}
void draw(){
for(int i = 0; i
0){
for(int i =0; i< rssLength;i++){ char c = headlinesTemp.charAt(i); if (c >= 97 && c <= 122) {
letterAmount[c-97]++;
}
//println(c);
}// end of i for loop
}//end of b loop
for(int i = 0; i < letterAmount.length; i++){
//println((char) (z+97) + ” ” + letterAmount[z]);
table[i].setAmount(letterAmount[i]);
textFont(f,16);
textAlign(LEFT);
text(letterAmount[i],letterPosX + 10,letterPosY +10);
/*
if(i < 6){ letterPosY = 0; letterPosX = i*106; } if((i >=6) && (i<12)){ letterPosY = 96; letterPosX = ((i%modInterval)*106); } if((i >=12) && (i<18)){ letterPosY = 192; letterPosX = ((i%modInterval)*106); } if((i >=18) && (i<24)){ letterPosY = 288; letterPosX = ((i%modInterval)*106); } if(i>=24){
letterPosY = 384;
letterPosX = ((i%modInterval)*106);
}
*/
}
}
Letter Object
class letter{
float x;
float y;
float letterWidth;
float letterHeight;
int totalAmount = 0;
letter(float tempX, float tempY, float widthLetter, float heightLetter){
x = tempX;
y = tempY;
letterWidth = widthLetter;
letterHeight = heightLetter;
}
void display(){
fill(totalAmount);
noStroke();
rect(x*106,y,letterWidth,letterHeight);
}
/*
void letterdisplay(char letterBig){
//takes in a letter and displays it at the top right with a margin of 10
textFont(f,16);
textAlign(LEFT);
text(letterBig,x*106 + 10,y +10);
}*/
void setAmount(int tempAmount){
totalAmount = tempAmount;
/*
takes the total amount and displays it
*/
}
}