Pcomp week8&9 Project2

Ideation

For this project, Alina and I formed a team to create this serial project together. We come from a different city in China, after discussion, both of us were interested in the food culture. Thus, we decided to use noodle as the medium to express our idea.

First version & Playtest

Alina drew the sketches, and I made the p5 examples to express out idea. https://editor.p5js.org/CastaZ/sketches/zB0wzUFaL

In week8, we play-tested our idea to Kevin during class. The first idea that came to his mind was to hold the disks up to see what going to happen on the screen. So we decided to change how the disks would be placed and how the food switches would be linked to the circuit.

Second version & Prototype

Then we worked seperately on p5 and arduino.

I was in charge to test the Arduino. I used leds as outputs first to show how switches change the leds on and off.

const int cucumber = 2;
const int shrimp = 3;

const int LedCucumber = 13;
const int LedShrimp = 12;

int cucumberState = 0;
int shrimpState = 0;

void setup() {
  // put your setup code here, to run once:
pinMode(cucumber, INPUT);
pinMode(shrimp, INPUT);

pinMode(LedCucumber, OUTPUT);
pinMode(LedShrimp, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
cucumberState = digitalRead(cucumber);
shrimpState = digitalRead(shrimp);


if (cucumberState == LOW){
  digitalWrite(LedCucumber, HIGH);
} else {
  digitalWrite(LedCucumber, LOW);
  }

if (shrimpState == LOW){
  digitalWrite(LedShrimp, HIGH);
} else {
  digitalWrite(LedShrimp, LOW);
  }

}

Third version & housing

ASCII and raw numbers.

//set buttons
const int cucumber = 2;
const int shrimp = 3;
const int squid = 4;
const int meat = 5;
const int egg = 6;
const int result = 7;

// variable for reading the button status
int cucumberState = 0;
int shrimpState = 0;
int squidState = 0;
int meatState = 0;
int eggState = 0;
int resultState = 0;

int lastcucumberState = 0;
int lastshrimpState = 0;
int lastsquidState = 0;
int lastmeatState = 0;
int lasteggState = 0;
int lastresultState = 0;

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

//initialize button pins as inputs
pinMode(cucumber, INPUT);
pinMode(shrimp, INPUT);
pinMode(squid, INPUT);
pinMode(meat, INPUT);
pinMode(egg, INPUT);
pinMode(result, INPUT);

}

void loop() {
// read the state of the button value;
cucumberState = digitalRead(cucumber);
shrimpState = digitalRead(shrimp);
squidState = digitalRead(squid);
meatState = digitalRead(meat);
eggState = digitalRead(egg);
resultState = digitalRead(result);

//check if the button is linked

if (cucumberState != lastcucumberState){
  Serial.print("0");
}
lastcucumberState = cucumberState;

if (shrimpState != lastshrimpState){
  Serial.print("1");
}
lastshrimpState = shrimpState;
 
if (squidState != lastsquidState){
  Serial.print("2");
}
lastsquidState = squidState;

if (meatState != lastmeatState){
  Serial.print("3");
}
lastmeatState = meatState;
 
if (eggState != lasteggState){
  Serial.print("4");
}
lasteggState = eggState;

if (resultState != lastresultState){
  Serial.print("5");
}
lastresultState = resultState; 

delay(100);

}