Wednesday, December 8, 2010

Final Project

I've finally finished my project. The end result was a a little less than I had originally anticipated but I achieved my main goal of getting my box operational. I had originally planed on having four buttons but due to a lot of complications with code and hardware I ended up only having one. Everything else works as originally designed, the box makes noise when tilted in a direction and the button also makes noise when pressed. The only problem is that the speakers I used aren't very powerful so they aren't very loud.

To make the housing for my components I used blue form insulation that I got from Lowes, black spray paint that I got from Hobby Lobby and Great Stuff spray foam insulation also from Lowes. I cut uniform  squares that I stacked on top of each other and "glued" together with the Great Stuff. I then smoothed out the edges with a knife and cut out the inside of the box. After that I "glued" side panels on to the sides to give it a more box like appearance and spray painted it black. After the paint dried I assembled the components for my box and used velcro to have a removable top. 

I have to give credit to user dany32412 for supplying his code so that I could use it for my project and Thomas Asmuth for helping me trouble shoot my projects problems and helping me figure out my code.








This is the code I used to make my box work. For the complete original code that this is based off of you can go to user dany32412 's profile oninstructibles.com or go to


#include <Wire.h>
#include "nunchuck_funcs.h"

int loop_cnt=0;

byte accx,accy,accz,joyx,joyy,zbut,cbut;
int ledPin = 13;
int Lledpin = 2; // left led
int Rledpin = 3; // right led
int Uledpin = 4; // up led
int Dledpin = 5; // down led

const int buttonPin = 7; // the number of the pushbutton pin
const int btnPin = 2; // the number of the LED pin
const int extraPin = 8;


// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int buttonState2 = 0;


void setup()
{
Serial.begin(19200);
nunchuck_setpowerpins();
nunchuck_init(); // send the initilization handshake

Serial.print("WiiChuckDemo ready\n");

pinMode(btnPin, OUTPUT); 
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
pinMode(extraPin, OUTPUT);
}

void loop()
{
buttonState2 = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) { 
// turn LED on: 
digitalWrite(btnPin, HIGH); 
} 
else {
// turn LED off:
digitalWrite(btnPin, LOW); 
}

if(buttonState2 == HIGH) {
digitalWrite(extraPin, HIGH);
} 
else {
digitalWrite(extraPin, LOW);
}

if( loop_cnt > 10 ) { // every 100 msecs get new data
loop_cnt = 0;

nunchuck_get_data();

accx = nunchuck_accelx();
accy = nunchuck_accely();
accz = nunchuck_accelz();
joyx = nunchuck_joyx();
joyy = nunchuck_joyy(); 
zbut = nunchuck_zbutton();
cbut = nunchuck_cbutton(); 
digitalRead(zbut);
if(zbut == 1 ){
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
//Left led accelerometer
if(accx <= 90){
digitalWrite(Lledpin, HIGH);
} else {
digitalWrite(Lledpin, LOW);}
//Right led accelerometer 
if(accx >= 180){
digitalWrite(Rledpin, HIGH);
} else {
digitalWrite(Rledpin, LOW);}
//Up led accelerometer
if(accy >= 165){
digitalWrite(Uledpin, HIGH);
} else {
digitalWrite(Uledpin, LOW);}
//Down led accelerometer
if(accy <= 100){
digitalWrite(Dledpin, HIGH);
} else {
digitalWrite(Dledpin, LOW);}
//Right led joystick
if(cbut == 1){
if(joyx >= 210){
digitalWrite(Rledpin, HIGH);
} else {
digitalWrite(Rledpin, LOW);}
//Left led joystick
if(joyx <= 50){
digitalWrite(Lledpin, HIGH);
} else {
digitalWrite(Lledpin, LOW);}
//Down led joystick
if(joyy <= 70){
digitalWrite(Dledpin, HIGH);
} else {
digitalWrite(Dledpin, LOW);}
//Up led joystick
if(joyy >= 210){
digitalWrite(Uledpin, HIGH);
} else {
digitalWrite(Uledpin, LOW);}
}




Serial.print("accx: "); Serial.print((byte)accx,DEC);
Serial.print("\taccy: "); Serial.print((byte)accy,DEC);
Serial.print("\taccz: "); Serial.print((byte)accz,DEC);
Serial.print("\tjoyx: "); Serial.print((byte)joyx,DEC);
Serial.print("\tjoyy: "); Serial.print((byte)joyy,DEC);
}
loop_cnt++;
delay(1);
}

Final Design

Monday, November 15, 2010

Final Prototype



My project idea is a ball that reacted to motion and impacts with sounds.  For the most part my project was successful when I began putting it together.  However, when  I put together the final product I ran into a few problems. I had 2 main problems, the first was the overall container that I decided to end up using, which was made of Styrofoam. I decided to use this particular material because of it’s availability, cost and how easy it was to carve out.  My main problem with this was that I ended up finding it  almost impossible to fit all of my components into the sphere. My second problem was that the button I decided to use stopped functioning once I assembled my product. I plan on continuing this project for my final, so I plan on trying to work these problems out. I plan on using plastic for the material for my final project and I plan on looking over both my code and my soldering.


Part of the code I used to make the button work I found at

The other part of my code and the general design of my project was from user dany32412 on instructables.com.





Monday, November 1, 2010

Prototype Project

I went to instructibles.com and I found more or less the main element of the project that I wanted to do by user dany32412. I used both Dany's code and hardware layout. Essentially, what Dany's project does is, using the Wii nunchuk's tilt sensor, allows the arduino to, when it senses the nunchuk tilt, it will make sound.
http://www.instructables.com/id/Wii-Nunchuck-Adapter/step9/Testing-The-adapter/?images#images





So, using Dany's instructible for the nunchuk and using Tiffpip79's http://tiffpip79.wordpress.com/ tutorial on impact sensors I should be able to create an interactive ball, similar to my design below.

This is what my prototype looks like so far. The the main difference between this project and Dany's is that I have replaced the LEDs with speakers to produce sound instead of light. 



Monday, October 25, 2010

Project Plans


My project idea is a ball that reacts to motion and impacts with sounds. 

This will show how the impact of the ball will work.

This is one of the ways the ball could sense being moved. This shows the tilt of an object.
http://www.arduino.cc/en/Tutorial/TiltSensor

This is one of the ways the ball could sense being moved. This shows the acceleration of an object.
http://arduino.cc/en/Tutorial/Memsic2125?from=Tutorial.AccelerometerMemsic2125

this shows what I would like the project to do.
http://www.youtube.com/watch?v=bk__bhQotFY

Monday, October 4, 2010

Saul Bass



Saul Bass’s poster Love in the Afternoon has a lot of subtle hints as to what might happen in the movie. Just from looking at the poster you can piece together that the movie has something to do with love based on the title. The large solid blind helps to enforce this as well as imply that the movie may have something to do with an affair. This idea is only further enforced by the subtle, slender hand that is pulling down the blind, which also adds a layer of secrecy to the whole poster. 

Saul Bass



Saul Bass’s poster Love in the Afternoon has a lot of subtle hints as to what might happen in the movie. Just from looking at the poster you can piece together that the movie has something to do with love based on the title. The large solid blind helps to enforce this as well as imply that the movie may have something to do with an affair. This idea is only further enforced by the subtle, slender hand that is pulling down the blind, which also adds a layer of secrecy to the whole poster. 

Project 7

Project 6

Project 5

Monday, September 27, 2010

Sound Project







For my project I decided to make a device that would increase and decrease the tempo of a looped song. I did this by, essentially, combining the analog input example and the tone music example from arduino.cc. The analog input program made it so that I could control how fast a light flashed with a nob, while the tone music program played a song one time. The wiring and layout I did for my project was the same as in both examples but the code was very different. Essentially, what I did was I altered the music program so that the song would play over and over again, I then add the code from the analog input program so that it would be able to alter the tempo of the song each time it played. If you would like to try what I did I'll be posting up the code and some more precise directions in a later post.

Analog Input
Tone Music

Sound Project Pictures






Comics


Rick Grimes – Walking Dead . The character Rick is the main hero in the seris and is portrayed as a protector throughout the seris. He is shown many times in either a authoritative or fatherly role through his actions and expressions toward other charecters. Whether it’s at the beginning of the seris and he’s wearing his police uniform or with an over grown beard and a tired look .

Rorschach – Watchmen. Rorschach   is the definition of a vigilante, he literally goes around and deals out justice without remorse or pity. But, the artist implies that the character has much more depth by what he does with Rorschach’s mask. The artist draws Rorschach’s mask differently each time as if it were shifting and not completely stable or solid.

Ash Williams – Army of Darkness. Ash’s character is the typical sarcastic hero with a chainsaw for a hand. Ash’s face in particular gives off the classic hero vibe with his slicked back hair and cleft chin. However, with the addition of the chainsaw and his trusty ”boomstick” it turns him into a unique person instead of the same cookie cutter hero.

Wednesday, September 1, 2010

Art Placement Experiment

With the yellow and red flashing lights that I constructed last class I made a little warning sign. The sign itself read "Caution: Possible Falling Objects", to the back of the sign I attached the battery and main components of the flashing lights. I then proceeded to make to small holes in the sign to allow the lights to poke through to the other side, creating a sign with flashing red and yellow lights. After I constructed this sign I had to come up with a good place to put it. So I decided that the door to a men's bathroom would be a suitable location. After attaching the tape to the door I found a spot adjacent to the bathroom to observe the results. I sat at that location for about an hour  and in that time period only a small handful of people interacted with the bathroom and the sign in that time period. The most common responses were that people either ignored the sign completely or stopped very briefly to examine the sign. In one case, however, one gentleman stopped at the door and examined the sign for a solid minute before finally deciding to use the restroom. Overall, I believe that the sign was effective on a small scale but I think that a larger scale sign would be more effective at giving people pause at entering a restroom.

project 2

Monday, August 30, 2010

Computer Poem


class Poem {
  public static void main(String[] args){
 
    string result = “nothing”;
    char prompt1, prompt2;
    string color1, color2;
        System.out.println(“Type Y for yes and N for no”);
        System.out.println(“Are Rosaceae primarily #ff0000?”);
            System.in.read(prompt1);
        System.out.println(“Are Viola papilionacea primarily #BF5FFF?”);
            System.in.read(prompt2);

    if(prompt1 == y){
        color1 = “#ff0000”;
    }

    if(prompt2 == y){
        color2 = “#BF5FFF”;
    }

    else{
        color1 =”nothing”;
        color2 = “nothing”;
    }

    if(color1 == “#ff0000”) && if(color2 == “#BF5FFF”){
    
        System.out.println("This unit recognizes itself as a personal computer.");
        
        result = "love";
    }
    
    else{
        result = "hate";
    }

    System.out.println("This computer terminal would like to expresses a sentiment of ") + result + (" towards 

the individual known as its primary user.");
   }
}