Tuesday, September 30, 2008

Jealous Boyfriend with servo technology

Meredith and I worked together on our Physical Computing homework and created a gem. Our task was create something using a servo motor. I knew that I wanted to attach a rigid arm to the motor. After playing with the setup we stumbled upon a funny little thing.

Enjoy :)

The Jealous Boyfriend with servo technology from Matt Richard on Vimeo.

Monday, September 22, 2008

The Voltage Reguator and the Circuit

This week for homework in pcomp(physical computing) I had to create circuits that were powered by 12v converter. Then the 12 volts were then turned into 5 volts by a 7805 5v regulator.  So far I have had no problems with any of labs, that is, until this one.

I can now honestly say I blew several LEDs and caused smoke to rise from them and I managed to destroy 3 voltage regulators. I also had the disadvantage of working on this lab without the diagrams on the server, due to it being offline.

However, I was able to understand the principles of measuring current and voltage, and working with a powersource other than the Arduino.

Here is a video of a simple circuit that I made.

Voltage Regulator and the Tower Switch!!! from Matt Richard on Vimeo.

ICM Homework Week 3

This week I was supposed to create classes and instantiate objects. Last week I tinkered with a random line drawing program. The way it works is simple:
1. pick a starting point
2. pick a point on an invisible circle
3. draw a line between points
3. the second point becomes the new starting point
4. repeat

I tried to limit the points on the circle so it was more like picking a point on the crust of a slice of pizza. I was attempting to make the movement smoother. What I got looked like a long tent pole that was unhinged and thrown onto the screen.

This was because I was using the random() function to pick a value. I switched to the noise() function and the result was much more fluid and ultimately cooler looking.

Clicking on the window resets the points to the mouse location.

Tuesday, September 16, 2008

Physical Computing Week 2 Homework

For week two I had to use a sensor(analog in) to send information to the Arduino that then used the data to regulate something else. In my case I used 3 potentiometers that controlled blue, green and red LEDs.

I wanted to create a way to make many different colors. I put the LEDs inside of a cube of foamcore with a paper window. Watch the videos to see how it went.

With the lights on so you can see the components.

Color Maker in the light from Matt Richard on Vimeo.

With the lights off so you can see it work.

Color Maker in the dark from Matt Richard on Vimeo.

Sunday, September 14, 2008

ICM Week 2 Homework part 2

My roommate, Jim Lamiell, had an assignment to create 4 squares representing the 4 quadrants of the stage. When the cursor is over a quadrant, that quadrant is black. When a cursor is not over a quadrant, it is gradually turning whiter, unless it is already white, in which case it remains white.

I wanted to recreate his project, but be able to change the total amount of squares and have it figure out all of the details. So I did. I used nested arrays and nested for loops to get it all to work. Not to mention the help of Jeremy and Thomas. Thanks guys :)

The example that I show has 256 squares. I am very excited for this little exercise because it has created a way to program matrices of LEDs for projects that I will be doing in the future.

Saturday, September 13, 2008

The search for Digital Devices

For Physical Computing, Meredith Hasson and I had to take a walk for one hour and record every use of a digital device. We recorded the time, device used, and the sex and estimated age of the user. We also took pictures and video of the users.

It seems that people do not mind if you take their pictures, or maybe they don't mind if Meredith takes them.

All in all the outcomes were expected, tons of iPods and cellphones. We compiled all of the data and media into a lovely video that you are sure to watch below. Enjoy.

The Hunt for Digital Devices from Matt Richard on Vimeo.

My computer crashed

My computer crashed because I was an idiot and turned it off during an update. When I restarted the computer there was a serious error and now my computer does not recognize my raid setup.

No problem though, all I need to do is find someone who will let me borrow two or three floppy disks so I can create a boot for my raid setup. Then I will be able to repair the problems to windows on my main hard drive(s).

Thursday, September 11, 2008

Fixing Physical Computing Homework

Thanks Kevin it seems to work :)

My brother Kevin, who lives in Florida and works as a Flash developer, had an idea about how to fix my code. He sent me a snippet of the void loop() section and I swapped it in and then rearranged the variables.

His idea was to check the switchState on every iteration of the for loop. Since switchState would only return 0 or 1(no or yes), he added the value of switchState to the lower of the two LED pins(pin 3) which were in pins 3 and 4.

Code snippet:
void loop() {
for (int i=10; i >= 1; i--){
// read the switch input at the beginning of
// each loop iteration
digitalWrite((ledPin + switchState), HIGH);
delay(i*(i*10));
digitalWrite((ledPin + switchState), LOW);
delay(i*(i*10));
}

Here is a video:

Physical Computing Week 1 Homework FIXED from Matt Richard on Vimeo.

Wednesday, September 10, 2008

ICM Week 2 Homework

This week, for ICM, I am supposed to create a drawing using variables! I was so excited that I did it a week ago :P I had actually worked on this before my self portrait.

I wanted to make concentric triangles, so I figured the easiest way would be to create a triangle based on its center point and radius. I created a class that figures out the 6 coordinate points by using trigonometry and then simply inputs them into the standard triangle() command.

Right now the triangles rotate based on the x position of your mouse. I am still playing with this, so I will be posting again soon.

Tuesday, September 9, 2008

Physical Computing Week 1 Homework

I finally got my Arduino Diecimila to work on my computer. I was really excited about programming in Arduino. It seemed like such a simple language that I just wanted to dive in and play around a bit.

I played with for loops allowing the LEDs to blink at either an exponentially increasing or decreasing amount. The LED that turns on depends on the position of a switch, whether it is open or closed. Here is my code:

// declare variables:
int switchPin = 2; // digital input pin for a switch
int yellowLedPin = 3; // digital output pin for an LED
int redLedPin = 4; // digital output pin for an LED
int switchState = 0; // the state of the switch

void setup() {
pinMode(switchPin, INPUT); // set the switch pin to be an input
pinMode(yellowLedPin, OUTPUT); // set the yellow LED pin to be an output
pinMode(redLedPin, OUTPUT); // set the red LED pin to be an output
}

void loop() {

if (switchState == 1) // if the switch is closed:
for (int i=10; i >= 1; i--){
digitalWrite(yellowLedPin, HIGH); // turn on the yellow LED
delay(i*(i*10));
digitalWrite(yellowLedPin, LOW); // turn off the yellow LED
delay(i*(i*10));
}
digitalWrite(redLedPin, LOW); // turn off the red LED
}
else if (switchState == 0){ // if the switch is open:
for (int i=1; i <= 10; i++){
digitalWrite(redLedPin, HIGH); // turn on the red LED
delay(i*(i*10));
digitalWrite(redLedPin, LOW); // turn off the red LED
delay(i*(i*10));
}
digitalWrite(yellowLedPin, LOW); // turn off the yellow LED
}
}
Here is a video:

The LEDs blinked the way I wanted them to, but the switch wouldn't change the lit LED until after the currently lit one was finished its for loop. I tried adding an if statement with a break to get the for loop to stop, but it didn't work.