Entradas

Mostrando las entradas de octubre, 2019

Interactive Art [Week 8] - Interactive Button

Imagen
Homework Code import processing.serial.*; Serial Port; int val; int TurnNum; int Boom; PImage img1; PImage img2; PImage img3; void setup()  { size(1000, 1000); printArray(Serial.list()); Port = new Serial(this, Serial.list()[1], 9600); TurnNum = 0; Boom  = (int) random(150); img1 = loadImage("1.png"); img2 = loadImage("2.png"); img3 = loadImage("3.png"); } void draw() {   //background(0);      if ( Port.available() > 0) {      val = Port.read();          println("Button Pressed: " + val);     println("Turn Num: " + TurnNum);     println("Boom: " + Boom);          if (TurnNum > Boom){       image(img3,0,0);     }   }      if (val == 0){     fill(0);   }else{     TurnNum = TurnNum + 1;          if (TurnNum >= 0 && TurnNum <=9){       image(img1,0,0);     }          if (TurnNum >= 10 &

Interactive Art [Week 7] - LED Video

Imagen
Homework 1 Code const int WhiteButtonPin = 8; const int RedButtonPin = 9; const int YellowButtonPin = 10; const int GreenButtonPin = 13; int WhiteButtonState = 0; int RedButtonState = 0; int YellowButtonState = 0; int GreenButtonState = 0; void setup() {   pinMode(WhiteButtonPin, OUTPUT);   pinMode(RedButtonPin, OUTPUT);   pinMode(YellowButtonPin, OUTPUT);   pinMode(GreenButtonPin, OUTPUT); } void loop() {   digitalWrite(GreenButtonPin, HIGH);   delay(300);   digitalWrite(YellowButtonPin, HIGH);   delay(300);   digitalWrite(RedButtonPin, HIGH);   delay(300);   for (int i = 0; i < 3; i++)   {     digitalWrite(RedButtonPin, HIGH);     digitalWrite(YellowButtonPin, HIGH);     digitalWrite(GreenButtonPin, HIGH);     delay(100);     digitalWrite(RedButtonPin, LOW);     digitalWrite(YellowButtonPin, LOW);     digitalWrite(GreenButtonPin, LOW);     delay(100);   }   delay(300);   for (int i = 0; i

Interactive Art [Week 5] - Arrays

Imagen
Week 5 - Arrays For this project I wanted to create a random selector of the main characteristics of the ball, size, color, and "bounciness" that are pre-stored in the corresponding array.  I also wanted to use an array that "creates" more balls but I couldn't do it :( so it's only an infinite array that creates balls of the same characteristics but they can't move. File:  https://drive.google.com/file/d/1GI8IdBBBGiUr35MZD994n0Tv36Veu3gi/view?usp=sharing