Wednesday, October 17, 2012

Arduino + Processing: first go.

THE CODE:


//CCLab Home work week_07
//Cupcake & Strawberry - array - radius - oscillation of an object - mouse
//Processing + Arduino

//new tab
PImage straw1 /*straw2*/;
// array -  first give it a name then a legnth
ArrayList Strawberry;

//Arduino button
import processing.serial.*;
import cc.arduino.*;
int pin = 5;
Arduino arduino;

int sensorValue;

void setup() {
  smooth();
  size(600, 600);
  
  arduino = new Arduino(this, Arduino.list()[0], 57600);
  noFill();
  noStroke();
  for (int i = 0; i <= 13; i++){
  arduino.pinMode(i, Arduino.INPUT);
 }
  
  //initialize first step
 Strawberry = new ArrayList();
 Strawberry.add(new Strawberry(width/2, height/2));

  straw1 = loadImage("straw1.png");
  //straw2 = loadImage("straw2.png");
    
}

void draw() {
  background(255);
  
  //Arduino button
  if (arduino.digitalRead(pin) == Arduino.HIGH){
     Strawberry.add(new Strawberry(mouseX, mouseY));
     
}
    else { 
      fill(0);
      noStroke();
    }
  
PImage myImage = loadImage("cake.png");
imageMode(CENTER);
image(myImage, width/2, height/2);

//I'm going to have a array of strawberry
 for(int i = 0; i < Strawberry.size(); i ++){
   Strawberry myStrawberry = (Strawberry) Strawberry.get(i);
   //this where you put it
   //draw the array
   myStrawberry.move();
   myStrawberry.display();
  
 }
   
//ellipse(280, 240, arduino.analogRead(pin), arduino.analogRead(pin));
  
    println(arduino.digitalRead(pin));
    
}

 /*void mousePressed(){
 Strawberry.add(new Strawberry(mouseX, mouseY));
 //telling what to do - add - calling the contucttor
 }*/

THE CLASS CODE:

class Strawberry {
  //Strawberry images
  PImage straw1 /*straw2*/;
  //color c;
  float xPos;
  float yPos;
  float ySpeed; //speed up and down
  float acc; //gathering speed

  Strawberry(float tempX, float tempY) { //same as class
  //strawberry(float tempYSpeed) { //feeding my donut //to make 1 a different speed
  straw1 = loadImage("straw1.png");
  //straw2 = loadImage("straw2.png");
  


    //c = color(0, 0, 0);
    xPos = random(0, width);
    yPos = height/2;
    ySpeed = 2; //tempYSpeed// take away the # value to change the speed
    acc = random(0.05, 0.3);
  }

  void display() { //can add aggument to change the color
    noStroke();//

   image(straw1, xPos, yPos, 100, 100);
   //image(straw2, xPos, yPos, 50, 50);

    }

  void move() {
    ySpeed += acc;
    yPos += ySpeed;
    
    if ((yPos >= height) || (yPos == 0)) {
      ySpeed *= -1;
      
     
      
    }
  }
}


Wednesday, October 10, 2012

Let There Be Code

Week01:
Get outside, get inspired and recreate a shape/object in Processing inspired by your time outside. This homework MUST use atleast one custom function, arrays and PImage and mouse interaction. Optionally use sin/cos and/or push and pop matrix. Share an image of what inspired you.

Week02:
Write your own class from scratch, give it some properties and functions. Make multiple objects of that class. Declare arguments in your class, and feed them values from the main code. Use Translate/push/pop matrix to make some interesting Interactions and tell a story. Advanced: Make an array of objects

Week03:
Create multiple objects using Arrays and have the objects interact with each other somehow - bounce, repulse etc. Add new objects upon mouse interaction. Make your objects interesting – not circles, rectangles squares. for eg. use PNGs.

Week04:
Use a library or multiple libraries to create an interesting audio-visual interaction with minimal or no use of mouse/keyboard. Using sin/cos and time will make your animations super interesting.

Week05:
Light two LEDs in your circuit. Incorporate Potentiometer or Push Button or another sensor for extra credit (extra fun!)

Two LED light will turn on when a button is pushed. Super simple and fun!


Week06:
Make a super fun interaction using sensors and objects
- think how you could make a simple instrument or capture a gesture, or embody an emotion
- make it meaningful
Use stuff we’ve learned so far – classes, libraries, sin/cos, so many things to work with!


STRAWBERRIES!!!!

To check out the CODE.

Stay tune for more fun stuff. Next on the ballot, XCode and OpenFrameworks.


Wednesday, October 3, 2012

Knights of Balls

I HEART "the Guild" like nobodies business!

The Guild

And since school, life, future, has been on my mind a lot and the six season of The Guild started this week I thought I'd share a funny .gif I found.


I to feel like I've got a lot to juggle. Literally.

Monday, October 1, 2012

I Need a Rosetta Stone for Code

Need a Job? You'd better learn code. *link
I do a lot of web-surfing, in fact I like to think of myself as a Pro Web-Surfer. It's kinda my thing! And I love it when I come across something that gets me jazzed about something-or-another about what I'm currently doing, what I want to do or that others are doing.

I really dig it when come across, what I call "the rhyme and reason" of things. What I mean is, when I land on something, a video, blog, write-up about a subject that I'm just getting into. For example, code. I'm just now learning this new language. I had experience with other code languages but I wasn't fluent.  I really didn't have a desire to be so. I just did the basic of code homework assignments, just what I understood. I never tried to push the boundaries of what code could do. I needed something to light the fire, a rhyme and/or reason. And what might you ask is that rhyme or reason? Why the best that there could be, a job. Yes I'm a little lame in that I'm letting the almighty job lead me. I'm going to need a job to pay for this education I'm getting and since this education is providing away to learn this "code" thing, I figure I might as well take advantage.

So bring on the code. Then a good job. Then paying off all my debt. Then retire on a mountain over looking a beach that has a huge city about 30 minutes away by car. The mountain is for my husband who wants a cabin on top of a mountain and the beach and city are for me.

Wednesday, September 26, 2012

Pop+Push Matrix gets a class

Pop+Push Matrix and their friends Class.



Check out this groovy code homework :)

Intro to CCLab

I'm very much a virgin code[r] when it comes to Processing. I can, somewhat, code for the web (HTML5), Flash (Action Script) and tiny bit of Xcode. My love for code goes about as far as, will here.  I don't really get it. It wasn't important to what I want to do. I knew what I needed to know to finish the assignment and get a good grade. When will I even need code? That sentiment is the old me, the before Parsons -- 3 week long -- Bootcamp. I am a new coder. I am a brave, ready to face code, coder. During the bootcamp you are introduces to Processing aka Code. It's one of them thing you either love or hate, black and white. You either understand it or you don't. I'm not a love or hate kinda person, I'm more of a "I enjoy that" kinda gal. I don't see in black or white, things are mostly tie-dyed, neon, rainbow and some times 50 shades of gray. Hehe! But at first code and I weren't seeing eye to [i] -- [i] here is representing [i] line of code that tells Processing to draw an array function -- just for all out there who don't know. So my first week with code was rocky. I kinda understood what things where doing, how they worked together to create sketches and tried to understand why I might need code.

Code language is not easy for me, it's my Achilles heel. Fun fact, most languages, compute or otherwise, are hard for me. Blast! I can barely speak English right sometimes. One thing I am is hard-headed and if there's something that's stomping me I find away around it. And I did with code. I asked questions. I asked everyone questions. I wanted to learn this. I went to workshops, I did my own research to see what others where doing with Processing, and how I wanted to use it. You see I'm a very very very visual learner. I learn by doing. I learn best when I know what the outcome will be. For example, in printmaking there's a method called etching. Etching is when you take a metal plate and a sharp point tool of some kind and scratch drawing into the plate then apply ink to the plate and paper and run it through a press. I know that doesn't sound exciting or hard but the technic as to how you get the drawing on the plate is exciting. There are many different methods as how you draw on the plate but one of them is using acid. You paint (special etching paint (I can't remember the name)) a coat on the plate. You then etch out your drawing. You dip the plate into the acid and the acid eats away the metal from just the part you drew. There's more process and I'm sure I'm not explaining it very well, but you get the point. For me it was hard to understand why I needed to go through some much process to get my drawing on the metal. I later figured out my frustration with etch was very simple, I didn't know what the out come was going to be. I didn't know how etching looked in the end. I had seen etching before but I didn't know how it was made. How long the metal stayed in the acid, what line where drawn first. I had to ask my teacher to break it down for me. I needed to know/see how it was down. Then I could go and do it, and I did. You can't tell me to do something and think it'll stick. But showing me something, doing something, and I won't forget. OK some times I will. I'm flighty! But I need to understand if I do this I can add this and together they make that. I have to see it. That's hard when it comes to processing sometimes.

So all of that just goes to show you that it was hard for me to be taught all this crazy code and then asked to use it to make something interesting. My head couldn't really wrap around what code function did what and what function did something else. So I copied code I worked on in class and played with it to understand what it did and why. During camp my homework weren't really bind blowing but they completed the assignment and I learned. The down side of this method was that it was a slow method. I spent to much time working and playing with simple code I got to comfortable with the easy stuff. Oops!

I do that. I get so comfy I don't adventure out. And I just realized that to. No more then a month into coding and I had not even adventured out into the code world to see what I could do. Lame! All my home for my Creative Computing Lab, or CCLab as we cool kids call it, has been lame. Not exciting at all. That's going to change. I want to be a good coder, maybe not the best but good. I can do that. I'm hard-headed enough to make that happen. In the end it's going to open so many groovy doors for me and what I can do. I just got to get over this comfy zone thing with code and make something epic.

For some more fun you can check out my Processing sketches at this link.

Open Processing Sketches

You can checkout my blog I kept over Bootcamp and see all my other fun projects from Code, Web and Design.

Parsons Bootcamp 2012

And for good measures you can follow my Tumblr of crazy meme's people at Parsons send each other.

Meme's From Parsons

Enjoy!

Wednesday, September 5, 2012

Code

Show casing some epic code for CCLab, check it out, HERE.

This sketch is my snow globe, sorta. I would like it to react to a few more functions, such as, after you get the snow going it falls to the bottom of the sketch. I'm not there yet but with some help from fellow classmate and bugging my teacher with my issues, I might figure it out.

Yay Code... stuff!!!