Archive by Author

Final Project – Interactive Box Array – Jake Brzezicki

21 Dec

ImageImageImageImageImageImage

I designed an interactive space of a system of boxes in a vertical array. I originally wanted to design it so that when a hand or other object came into close proximity to the boxes, then the boxes would move out of the way using servo motors and the tied string. This would have been done by using the lead motion control to track the hand, then when it got close, activate the motors and move the boxes. Unfortunately, I was running low on time so I was only able to make it so the boxes would move from the motors, and I hooked it up to a potentiameter. 

The main process was focused around building a base structure for the boxes to hang from and from where the motors would pull. The wood frame is constructed from 1.5 x 1.5 inch wood rods, and loop screws that the string was fed through. I made it at 4 ft scale, but should have gone smaller, but if was all successful I could imagine it as a large interactive installation somewhere that people would have to walk through it and have some fun. For the movement I just used a basic servo motor code with the arduino and bread board connected to the motors with the potentiometer. Also a counterweight to keep the string taught. The boxes were able to move, not as much as I wanted, but it was a start. It was suggested that I have 2 potentiometers to lessen the load on one so I tried to program that but that didn’t work. Fortunately the 1 potentiometer was able to handle the 5 motors. For future iterations I would try to design the array better, and work of the code, as well as try to incoporate the lead motion aspect.

Code:

#include <Servo.h>

Servo microservo;

Servo microservo2;
Servo microservo3;
Servo microservo4;
Servo microservo5;
Servo microservo6;
int pot = 0;
int pott = 0;
int val;
int vall;

void setup() {
microservo.attach(1); // put your setup code here, to run once:
microservo2.attach(2);
microservo3.attach(3);
microservo4.attach(5);
microservo5.attach(6);
microservo6.attach(7);
}

void loop() {
val = analogRead(pot); // put your main code here, to run repeatedly:
vall = analogRead(pott);
val = map(val, 0, 1023, 0, 179);
vall = map(vall, 0, 1023, 0, 179);
microservo.write(val);
microservo2.write(val);
microservo3.write(val);
microservo4.write(vall);
microservo5.write(vall);
microservo6.write(vall);
delay(5);

}

Advertisements
Image

Homework 04-Complex Circuit-Jake Brzezicki

5 Nov

Homework 04-Complex Circuit-Jake Brzezicki

int LED = 13;//sets led to 13
int Button = 7;//sets button to 7
int previous_val = 0;
int val = 0;
int state = 0;
void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
pinMode(Button, INPUT);
}

void loop() {
int sensorReading =analogRead(A0);//photosensor goes to A0
Serial.println(sensorReading);
int thisPitch =map(sensorReading, 30, 865, 120, 800);//sensor range
tone(9, thisPitch, 10);
delay(1);

val = digitalRead(Button);

if ((val == HIGH) && (previous_val == LOW)) {
state = 1 – state;
delay(10);
}
previous_val = val;

if (state == 1) {
digitalWrite(LED, HIGH);
}else{
digitalWrite(LED, LOW);
}
}

Image

Homework_03-Servo Motor & LEDs-Jake Brzezicki

31 Oct

Homework_03-Servo Motor & LEDs-Jake Brzezicki

#include
Servo microservo;
int pot = 0;
int val;
int red = 3;//assigns LED to port
int blue = 5;
int green = 6;
void setup() {
microservo.attach(9);
pinMode(red, OUTPUT);//sets LED to output
pinMode(blue, OUTPUT);
pinMode(green, OUTPUT);
}

void loop() {

val = analogRead(pot); //potentiometer controls motor
val = map(val, 0, 1023, 0, 179);
microservo.write(val);
delay(10);

pot = (analogRead(A0));
digitalWrite(green, HIGH);//LED is on
delay(pot);
/*digitalWrite(green, LOW);
delay(pot);*/
digitalWrite(red, HIGH);
delay(pot);
/*digitalWrite(red, LOW);
delay(pot);*/

digitalWrite(blue, HIGH);//LED is controlled by potentiometer
delay(pot);
digitalWrite(blue, LOW);
delay(pot);
}

Image

Homework_02-LED lights-Jake Brzezicki

31 Oct

Homework_02-LED lights-Jake Brzezicki

int red = 3;//assigns LED to port 3
int blue = 5;
int green = 6;

void setup() {
pinMode(red, OUTPUT);//sets LED to output
pinMode(blue, OUTPUT);
pinMode(green, OUTPUT);

}

void loop() {

digitalWrite(blue, HIGH);//LED turns on
delay(150);
digitalWrite(green, LOW);//LED turns off
delay(150);
digitalWrite(red, LOW);
delay(150);
digitalWrite(blue, LOW);
delay(150);
digitalWrite(green, HIGH);
delay(150);
digitalWrite(red, HIGH);
delay(150);

}