Author Archives: caitlinfancy

Project #3C

Coding used for final project

 

import processing.video.*;
//name the video so it can find it further on down.
Movie thevideo;
boolean isPlaying;
boolean isLooping;

// An array of font,
String[] headlines = {
“Sometimes we are looking for the beauty in broken things – 2014”,

};
//prepare the font lables.
PFont f; // Global font variable
float x; // horizontal location of headline
int index = 0;
void setup() {
//setting up frame size and frame rate, along with speed of imagery
size(640, 480);
frameRate(10);
f = createFont(“Arial”,50,true);
// Initialize headline offscreen to the right
x = width;

//import video from data file
thevideo = new Movie(this, “Sequence 1.mov”);

thevideo.loop(); //plays the movie over and over
isPlaying = true;

}
//DISPLAY IMAGE WITH NO MOVEMENT RELATED TO MOUSE X AND Y
void draw() {
background(0);
image(thevideo, 0, 0);

//MOVE THE FONT DOWN AT THE BOTTOM OF THE IMAGE
// Display headline at x location
textFont(f,50);
textAlign(BOTTOM);
text(headlines[index],x,470);
//allows the speed to be effected
// Decrement x
x = x – 3;

//THIS CODE WOULD BE USED TO MAKE IT REPEAT OVER AND OVER.
// If x is less than the negative width,
// then it is off the screen
//float w = textWidth(headlines[index]);
// if (x < -w) {
// x = width;
// index = (index + 1) % headlines.length;
}

 

void movieEvent(Movie m) {
m.read();
}

//causes the image to pause.
void keyPressed() {
if (key == ‘p’) {
// toggle pausing
if (isPlaying) {
thevideo.pause();
} else {
thevideo.play();
}
isPlaying = !isPlaying;

//create a loop to the begining.
} else if (key == ‘l’) {
// toggle looping
if (isLooping) {
thevideo.noLoop();
} else {
thevideo.loop();
}
isLooping = !isLooping;

//makes the footage stop
} else if (key == ‘s’) {
// stop playing
thevideo.stop();
isPlaying = false;

//cut to new scene
} else if (key == ‘c’) {
// jump to a random time
thevideo.jump(random(thevideo.duration()));
}
}

Advertisements

Fancy_Project#3B

Coding for my assignment 3B

//need to be able to set up a frame rate for the screen as well as a size.
void setup() {
size(400, 400);
frameRate(4);
smooth();

}
//names assigned to each individual item. you need to be able to call upon.
int pos = 0;
int saveNum=0;

void draw() {
exportFrame();

//background color
background(255);
// if any button is pressed it will result in the screen going completely black in color while if not pressed
screen will be white and display objects.
if(keyPressed == true) {
background(0);
}
//screen will display white.
else {
background(255);

// calling upon the rectangle where it is located 90, 180 somewhat middle of the screen.
pos++;
rect(pos, 90, pos, 180);
fill(0);
if (pos > width)
pos = 0;

//the ellipse will move based upon where the mouse X AND Y are located watch as it follows on the screen.
ellipse(mouseX, mouseY, 60, 60);

 
println(“mouseX = ” + mouseX, “mouseY = ” + mouseY);
//this will make the
fill( random(255), random(255), random(255), random(255));
}
}

 

//pressing s as either small letter or capital letter will allow you to save the image in the folder that the code is saved to.
void exportFrame() {
if(keyPressed){
if(key == ‘s’ || key == ‘S’) {
save(“masterpiece” + saveNum + “.png”);
saveNum++;
}
}
}

20140326-013946.jpg

20140326-013959.jpg

20140326-014007.jpg

20140326-014052.jpg

20140326-014218.jpg

Reading response March 17th

Does interactivity happen to surpress our creativity or merely enhance the possibilities to go above and beyond?

Do you have to physically interact with something in order to enjoy it completely, or can one just watch and get the same kind of entertainment?

Project #3A Reconstruction of painting

Screen Shot 2014-03-17 at 12.11.51 AMScreen Shot 2014-03-17 at 12.28.25 AM

Final copy of reconstruction.

The coding used to create.

//size of the rectangle
size(620,570);
//change background to black
background(0);
noStroke();
fill(255,242,188);
rect(0,0,175,175);

//red rectangle
fill(150,0,0);
rect(190,0,540,397);

//second from the top yellow rectangle
fill(255,242,188);
rect(0,200,175,195);
//
//navy blue rectangle
fill(4,33,89);
rect(0,410,175,198);

//white block bottom middle
fill(255,242,188);
rect(190,410,360,397);

//right white far right
fill(255,242,188);
rect(560,410,500,80);

//orange bottom block
fill(222,158,11);
rect(560,500,500,70);

Project #2: hybrid interaction.

20140304-142410.jpg20140310-105835.jpg20140310-105849.jpg

20140310-105903.jpg20140310-105927.jpg

In the images above you will see the construction of the ferris wheel as well as the main 2 sensors on the breadboard.

Coding for my project for all 3 sensors

#include <Servo.h>
Servo myServo;

int const potPin = A0;
int potVal;
int angle;
const int switchPin = 2;
const int motorPin = 9;
int switchState;
int lastswitchState = LOW;
int onOff = LOW;

//LEDsensor lighting coding in which changes the colors of the main LED light.

const int greenLEDPin = 12;
const int redLEDPin = 11;
const int blueLEDPin = 10;

const int  redSensorPin = A1;
const int  greenSensorPin = A2;
const int  blueSensorPin = A3;

int redValue = 0;
int greenValue = 0;
int blueValue = 0;

int redSensorValue = 0;
int greenSensorValue = 0;
int blueSensorValue = 0;

void setup() {
myServo.attach(8);

Serial.begin(9600);

//motor setup
pinMode(motorPin, OUTPUT);
pinMode(switchPin, INPUT);

//LED setup
Serial.begin(9600);

pinMode(greenLEDPin, OUTPUT);
pinMode(redLEDPin, OUTPUT);
pinMode(blueLEDPin, OUTPUT);
}
// Make sure the object and sensor does not loop.
void loop() {
potVal = analogRead(potPin);
Serial.print(“potVal: “);
Serial.print(potVal);

angle = map(potVal, 0, 1023, 0, 179);
Serial.print(“, angle: “);
Serial.print(angle);

myServo.write(angle);
delay(15);

switchState = digitalRead(switchPin);

redSensorValue = analogRead(redSensorPin);
delay(5);
greenSensorValue = analogRead(greenSensorPin);
delay(5);
blueSensorValue = analogRead(blueSensorPin);

Serial.print(“Raw Sensor Value \t Red: “);
Serial.print(redSensorValue);
Serial.print(“\t Green: “);
Serial.print(greenSensorValue);
Serial.print(“\t Blue: “);
Serial.print(blueSensorValue);

redValue = redSensorValue/4;
greenValue = greenSensorValue/4;
blueValue = blueSensorValue/4;

Serial.print(“mapped Sensor Value \t Red: “);
Serial.print(redValue);
Serial.print(“\t Green: “);
Serial.print(greenValue);
Serial.print(“\t Blue: “);
Serial.print(blueValue);

analogWrite(redLEDPin, redValue);
analogWrite(greenLEDPin, greenValue);
analogWrite(blueLEDPin, blueValue);

//this is for the motor code ON/OFF

if (switchState == HIGH && lastswitchState == LOW) {
if(onOff == LOW) {
onOff = HIGH;
}
else if(onOff == HIGH) {
onOff = LOW;
}
lastswitchState == HIGH;
if (switchState == LOW) {
lastswitchState = LOW;
}
}

digitalWrite(motorPin, onOff);
}

Project #2 planning

Control the speed http://www.dummies.com/how-to/content/how-to-control-the-speed-of-a-dc-motor-with-the-ar.html

The text in which is needed for the design of my project number 2.

night light setup

void setup() {
Serial.begin(9600);
pinMode(3, OUTPUT);
}
void loop() {
int sensorValue = analogRead(A0);
if (sensorValue < 200) { // To change the point at which the light turns on change this value.
digitalWrite(3, HIGH);
}
else {
digitalWrite(3,LOW);
}
}

http://makezine.com/projects/arduino-controlled-night-light/ website for coding
^^ This is the sensor light in which the LEDs go on when the sensor is covered.

const int switchPin = 2;
const int motorPin = 9;
int switchState = 0;

void setup() {
pinMode(motorPin, OUTPUT);
pinMode(switchPin, INPUT);
}

void loop(){
switchState = digitalRead(switchPin);

if (switchState == HIGH) {
digitalWrite(motorPin, HIGH);
}
else {
digitalWrite(motorPin, LOW);
}
}
coding for the process in which the wheel spins.

Must still figure out how to control the speed in which the wheel spins.

the other idea is to go with the LCD screen saying open or closed depending on the operation of the wheel itself.

Coding for ardiuno projects

20140224-183534.jpg

20140224-183526.jpg

01.wpid-20140209_210448.jpgwpid-20140209_211953.jpgwpid-20140209_212017.jpg

02.

wpid-20140209_214933.jpg
int switchState = 0;
void setup () {
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(2,INPUT);
}
void loop(){
switchState = digitalRead(2);
//this is a comment

if (switchState == LOW){
digitalWrite(3, HIGH);//green LED
digitalWrite(4, LOW); // red LED
digitalWrite(5, LOW); //red LED
}

else { // the button is pressed
digitalWrite(3,LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);

delay(250); //wait for a quarter of a second
//toggl the LEDS
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(250); //wait for a quarter second
}
} // go back to the beggining of the loop

03. Love-o-meter

wpid-20140209_215849.jpg

const int sensorPin = A0;
const float baselineTemp = 20.0;
void setup(){
Serial.begin(9600); //open a serial port
for(int pinNumber = 2; pinNumber<5; pinNumber++){
pinMode(pinNumber,OUTPUT);
digitalWrite(pinNumber, LOW);
}
}

void loop(){
int sensorVal = analogRead(sensorPin);
Serial.print(“Sensor Value: “);
Serial.print(sensorVal);

//convert the ADC reading to voltage
float voltage = (sensorVal/1024.0) *50;
Serial.print(“, Volts: “);
Serial.print(voltage);
Serial.print(“, degrees C: “);
//convert the voltage to temperature in degrees
float temperature = (voltage – .5) * 100;
Serial.println(temperature);

if(temperature < baselineTemp){
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}else if(temperature >=baselineTemp+2 &&
temperature <baselineTemp+4){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
}else if (temperature >=baselineTemp+6){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
}
delay(1);
}
04. Color mixing lamp

wpid-20140209_231140.jpg

const int greenLEDPin = 9;
const int redLEDPin = 11;
const int blueLEDPin = 10;

const int redSensorPin = A0;
const int greenSensorPin = A1;
const int blueSensorPin = A2;

int redValue = 0;
int greenValue = 0;
int blueValue =0;

int redSensorValue = 0;
int greenSensorValue = 0;
int blueSensorValue= 0;

void setup(){
Serial.begin(9600);
pinMode(greenLEDPin, OUTPUT);
pinMode(redLEDPin, OUTPUT);
pinMode(blueLEDPin, OUTPUT);
}

void loop(){
redSensorValue = analogRead(redSensorPin);
delay(5);
greenSensorValue = analogRead(greenSensorPin);
delay(5);
blueSensorValue = analogRead(blueSensorPin);
Serial.print(“Raw Sensor Values \t Red: “);
Serial.print(redSensorValue);
Serial.print(“\t Green: “);
Serial.print(greenSensorValue);
Serial.print(“\t Blue: “);
Serial.print(blueSensorValue);
redValue = redSensorValue/4;
greenValue = greenSensorValue/4;
blueValue = blueSensorValue/4;

Serial.print(“Mapped Sensor Values \t Red: “);
Serial.print(redValue);
Serial.print(“\t Green: “);
Serial.print(greenValue);
Serial.print(“\t Blue: “);
Serial.print(blueValue);
analogWrite(redLEDPin, redValue);
analogWrite(greenLEDPin, greenValue);
analogWrite(blueLEDPin, blueValue);
}0

05. Mood Cue

wpid-20140210_001803.jpg

#include <Servo.h>
Servo myServo;

int const potPin =A0;
int potVal;
int angle;
void setup() {
myServo.attach(9);

Serial.begin(9600);
}

void loop() {
potVal = analogRead(potPin);
Serial.print(“potVal: “);
Serial.print(potVal);
angle = map(potVal, 0, 1023, 0, 179);
Serial.print(“, angle: “);
Serial.println(angle);

myServo.write(angle);
delay(15);
}

06. Light theremin

wpid-20140210_003245.jpg

int sensorValue;
int sensorLow =1023;
int sensorHigh = 0;

const int ledPin = 13;
void setup(){
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);
while (millis() < 5000) {
sensorValue = analogRead(A0);
if (sensorValue > sensorHigh) {
sensorHigh = sensorValue;
}
if (sensorValue < sensorLow) {
sensorLow = sensorValue;
}
}

digitalWrite(ledPin, LOW);
}

void loop (){
int pitch =
map(sensorValue, sensorLow, sensorHigh, 50, 4000);

tone(8,pitch,20);
delay(10);
}

07. Keyboard instrument

wpid-20140210_005522.jpg

int buttons[6];
//set up an array with 6 integers

int notes[] = {262,294,330,349};

void setup() {
Serial.begin(9600);
}

void loop() {
int keyVal = analogRead(A0);
Serial.println(keyVal);
if(keyVal ==1023){
tone(8, notes[0]);
}

else if (keyVal >= 990 && keyVal <= 1010){
tone(8, notes[1]);
}
else if(keyVal >= 505 && keyVal <= 515){
tone(8, notes[2]);
}
else if(keyVal = 5 && keyVal <= 10){
tone(8, notes[3]);
}
else{
noTone(8);
}
}

08. Did not need to complete

09. Motorized pinwheel

const int switchPin = 2;
const int motorPin = 9;
int switchState = 0;

void setup() {
pinMode(motorPin, OUTPUT);
pinMode(switchPin, INPUT);
}

void loop(){
switchState = digitalRead(switchPin);

if (switchState == HIGH) {
digitalWrite(motorPin, HIGH);
}
else {
digitalWrite(motorPin, LOW);
}
}

10. Zoetrope

wpid-20140210_151135.jpg wpid-20140210_153534.jpg

11. Crystal Ball

wpid-Snapchat-20140210042932.jpg

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int switchPin = 6;
int switchState = 0;
int prevSwitchState = 0;
int reply;

void setup() {
lcd.begin(16, 2);
pinMode(switchPin,INPUT);
lcd.print(“Ask the”);

lcd.setCursor(0, 1);
lcd.print(“Crystal Ball!”);
}

void loop() {
switchState = digitalRead(switchPin);

if (switchState != prevSwitchState) {
if (switchState == LOW) {
reply = random(8);

lcd.clear();
lcd.setCursor(0, 0);
lcd.print(“The Ball says:”);
lcd.setCursor(0, 1);
switch(reply){
case 0:
lcd.print(“yes”);
break;
case 1:
lcd.print(“Most Likely”);
break;
case 2:
lcd.print(“Certainly”);
break;
case 3:
lcd.print(“Outlook good”);
break;
case 4:
lcd.print(“unsure”);
break;
case 5:
lcd.print(“ask again”);
break;
case 6:
lcd.print(“doubtful”);
break;
case 7:
lcd.print(“NO”);
break;
}
}
}
prevSwitchState = switchState;
}

12. Knock Lock

wpid-Snapchat-20140210050917.jpg

#include <Servo.h>
Servo myServo;
const int piezo = A0;
const int switchPin = 2;
const int yellowLed = 3;
const int greenLed = 4;
const int redLed = 5;

int knockVal;
int switchVal;

const int quietKnock = 10;
const int loudKnock = 100;

boolean locked = false;
int numberOfKnocks = 0;

void setup(){
myServo.attach(9);
pinMode(yellowLed, OUTPUT);
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(switchPin, INPUT);
Serial.begin(9600);
digitalWrite(greenLed, HIGH);
myServo.write(0);
Serial.println(“the box is unlocked!”);
}

void loop(){
if(locked == false){
switchVal = digitalRead(switchPin);
if(switchVal == HIGH){
locked = true;
digitalWrite(greenLed, LOW);
digitalWrite(redLed, HIGH);
myServo.write(90);
Serial.println(“The box is locked!”);
delay (1000);
}
}

if(locked == true){
knockVal = analogRead(piezo);
if(numberOfKnocks < 3 && knockVal > 0){
if(checkForKnock(knockVal) == true){
numberOfKnocks++;
}
Serial.print(3-numberOfKnocks)

;
Serial.println(“more knocks to go”);
}
if(numberOfKnocks >= 3){
locked = false;
myServo.write(0);
delay(20);
digitalWrite(greenLed,HIGH);
digitalWrite(redLed,LOW);
Serial.println(“the box is unlocked!”);
}
}
}
boolean checkForKnock(int value){
if(value > quietKnock && value < loudKnock){
digitalWrite(yellowLed, HIGH);
delay(50);
digitalWrite(yellowLed,LOW);
Serial.print(“valid knock of value”);
Serial.print(value);
return true;
}
else {
Serial.print(“bad knock value”);
Serial.println(value);
return false;
}
}

13. touchy feely lamp

wpid-20140222_001001.jpg

I could not figure out how to get this one to work the coding was not working no matter what way I had gone about it. I had set it all up but could not get the coding to go through

int threshold = 1000;
const int ledPin = 12;

void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
long sensorValue = capSensor.capacitiveSensor(30);
Serial.println(sensorValue);

if(sensorValue > threshold) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite, LOW);
}
delay(10);
}

14.wpid-20140221_235147.jpg

void setup() {
Serial.begin(9600);
}
void loop() {
Serial.write(analogRead(A0)/4);
delay(1);
}

image processing.serial.*;
Serial myPortl
PImage logo;
int bgcolor = 0;
void setup() {
colorMode(HSB, 225);
logo = loadImage(“http://arduino.cc/logo/png&#8221;);
size(logo.width, logo.height);
println(“Available serial ports:”);
println(Serial.list());
myPort =
new Serial(this, Serial.list()[10], 9600);
}
void draw() {
if (myPort.available() > 0) {
bgcolor = myPort.read();
println(bgcolor);
}
background(bgcolor, 255, 255);
image(logo, 0, 0);
}

same thing happened with this, while entering in the code the parts that should had lit up remained darkened then while trying to fit in the code, it would not produce the code needed to continue with the coding itself.

20140224-183509.jpg

20140224-183520.jpg

Week 4-5 blog entry

We got introduced to this the subjectivity of interaction there is many different types of interactions. As a class we were able to experience with many different types of interactions whether or not it was constructing an interaction or merely being the subject of interest for the interaction to take place, regardless of what we were doing the equation was a + b = c in most cases. We predominately worked within the fact that within interaction there can be censors in objects.

 

As a class we discussed what had sensors in it and I completely forgot about how many items within just a house could have the result of sensors. Take something such as a thermostat nothing we really consciously think about we set it and it does its job without the worry of an individual to continuously watch it. So does sensors essentially make our lives easier and make us lazier? Technology is advancing to the point that we no longer even need a remote to change to channel on the TV our TVs can now simply read our movements and determine what action to take without having to search the house for a remote that happens to be stuck within the couch cushion!

 

Does this happen to be a pro or a con. Will these advancements essentially make us dependent on technology for every day activities?

Get the facts

http://www.theatreoutre.ca/about-us/venue/

After reading this it really blew my mind a little bit. Living in Lethbridge has been extremely hard over the years. I cannot believe how much hate is within the Lethbridge area towards others.

Week 4: POP UP BOOK POST

This pop up assignment was interesting it allowed me to explore a whole new way to interact with something as simple as paper. It created the equation that if you do this, that will happen while making it fun and interesting. I took a little bit of a different approach with this in the way that I made it interactive I did however struggle a little bit with coming up with a solid idea and going with it as many of my initial ideas did not pan out the way I had imagined them in my head and drawn out on paper. 😦

!
Where? :: Why this structure? What made you settle on the idea you did?!

I really enjoyed the castle theme, I was discussing with a friend Game of Thrones which triggered some different ideas such as sleeping beauty, snowwhite and everything I really enjoyed as a child. I drew some different ideas in which I wanted to incorporate into my design.
How? :: Directing us to the appropriate photos (see below) talk about your construction process.

I began with my prototype designing how I wanted to construct my book I think this was the most important step without a foundation I was unable to build upon my idea and lay things out. I had completely forgotten to take any photos of my final attempt of construction I do however have a picture from a friend of me clearly loving every moment of my design.
Problems? Solutions? What would you do differently next time?!

Problems that I most commonly ran into was the fact that once you cut paper its really hard to fix that mistake. I got stuck with the construction of my first page, initially I wanted to include a door on the castle but that however did not work the way I intended so I instead decided on a moon. Now the process in which I had to follow to get that done was tricky to find something that was strong enough to keep the momentum of the moon without it getting stuck so it could fluidly move back and forth. I settled on using a pipe cleaner initially and that was too flimsy so I had to put something around that to support it. The only thing I could find that would remotely work would be a straw in which gives it a bit more support to the pushing and pulling motion. If I had thought about it previously I would have instead used a stronger wire or something slightly smaller. I had an idea with a mirror and again that did not pan out either as the tin foil I was intending on using was not reflective enough and would not work for the purpose it which I wanted it to serve. I would have liked to have done it but with the lack of materials handy it was difficult to pull that one off.
Who? :: Discuss your intended audience.!

My intended audience would be a younger audience as this is so simple and child like I do believe if I were to put a target audience it would be ages between 3-6 years of age.

Why? :: Speak to the interactive capabilities of paper engineering generally, as well as your
book specifically. What is our attraction to these objects?!

I couldn’t think of anything super crazy to do however I kind of switched up the interactivity that I used it is so generic to just use the push and pull and I wanted to do something a little bit different. On page two I used a wax paper in which I put over top of the text, to give the audience a chance to really explore by seeing and touching. Doing this allows the audience to read some text that I had put under the wax paper. The audience needs to move the paper around in order to make out the poem that is located beneath the paper.

The 3rd page kind of didn’t work out the way I had initially intended however I wanted to keep with the castle type theme which a big giant old clock in which allows you to move the hands on the clock is fun and kind of gave me the idea that what you do with the time is up to you.. just kind of how life plays out – what you decide to do with your time is up to you. Then I wanted to continue with the child theme including a mouse but first a little riddle with painted on foot prints to where you’ll find the little mouse hiding under the other flap, and the audience gets a little surprise when they find the little mouse hiding.

20140127_130937 20140127_131014 20140127_1310452014-01-27 13.07.14

 

Prototype

20140121_004629 20140121_004636 20140121_004642