Week 11 – Serial Communication

For this assignment, I collaborated with Shahd. We based our project on the example codes and made changes as we see appropriate. Shahd did the second exercise and I did the first exercise. We worked together to complete the third exercise.

Video:

Exercise 1:

p5 sketch:

int leftLedPin = 7;
int rightLedPin = 4;


void setup() {
 // Start serial communication so we can send data
 // over the USB connection to our p5js sketch
 Serial.begin(9600);


 // We'll use the builtin LED as a status output.
 // We can't use the serial monitor since the serial connection is
 // used to communicate to p5js and only one application on the computer
 // can use a serial port at once.
 pinMode(LED_BUILTIN, OUTPUT);


 // Outputs on these pins
 pinMode(leftLedPin, OUTPUT);
 pinMode(rightLedPin, OUTPUT);


 // Blink them so we can check the wiring
 digitalWrite(leftLedPin, HIGH);
 digitalWrite(rightLedPin, HIGH);
 delay(200);
 digitalWrite(leftLedPin, LOW);
 digitalWrite(rightLedPin, LOW);






 // start the handshake
  while (Serial.available() <= 0) {
    digitalWrite(LED_BUILTIN, HIGH);  // on/blink while waiting for serial data
    Serial.println("0,0");            // send a starting message
    delay(300);                       // wait 1/3 second
    digitalWrite(LED_BUILTIN, LOW);
    delay(50);
  }
}


void loop() {
 // wait for data from p5 before doing something
 while (Serial.available()) {
   digitalWrite(LED_BUILTIN, HIGH);  // led on while receiving data


   if (Serial.read() == '\n') {


     int sensor = analogRead(A1);  //potentiometer
     Serial.println(sensor);
   }
 }
 digitalWrite(LED_BUILTIN, LOW);
}

Exercise 2:

int leftLedPin = 6;


void setup() {
 // Start serial communication so we can send data
 // over the USB connection to our p5js sketch
 Serial.begin(9600);




 // We'll use the builtin LED as a status output.
 // We can't use the serial monitor since the serial connection is
 // used to communicate to p5js and only one application on the computer
 // can use a serial port at once.
 pinMode(LED_BUILTIN, OUTPUT);


 // Outputs on these pins
 pinMode(leftLedPin, OUTPUT);


 // start the handshake
 while (Serial.available() <= 0) {
   digitalWrite(LED_BUILTIN, HIGH);  // on/blink while waiting for serial data
   Serial.println("0,0");            // send a starting message
   delay(200);                       // wait 1/3 second
   digitalWrite(LED_BUILTIN, LOW);
   delay(200);
 }
}




void loop() {
 // wait for data from p5 before doing something
 while (Serial.available()) {
   digitalWrite(LED_BUILTIN, HIGH);  // led on while receiving data


   int brightness = Serial.parseInt();
   analogWrite(leftLedPin, brightness);
   if (Serial.read() == '\n') {
     Serial.println("0,0");
   }
 }
 digitalWrite(LED_BUILTIN, LOW);
}


Exercise 3:

int leftLedPin = 7;
int rightLedPin = 4;


void setup() {
 // Start serial communication so we can send data
 // over the USB connection to our p5js sketch
 Serial.begin(9600);


 // We'll use the builtin LED as a status output.
 // We can't use the serial monitor since the serial connection is
 // used to communicate to p5js and only one application on the computer
 // can use a serial port at once.
 pinMode(LED_BUILTIN, OUTPUT);


 // Outputs on these pins
 pinMode(leftLedPin, OUTPUT);
 pinMode(rightLedPin, OUTPUT);


 // Blink them so we can check the wiring
 digitalWrite(leftLedPin, HIGH);
 digitalWrite(rightLedPin, HIGH);
 delay(200);
 digitalWrite(leftLedPin, LOW);
 digitalWrite(rightLedPin, LOW);






 // start the handshake
  while (Serial.available() <= 0) {
    digitalWrite(LED_BUILTIN, HIGH);  // on/blink while waiting for serial data
    Serial.println("0,0");            // send a starting message
    delay(300);                       // wait 1/3 second
    digitalWrite(LED_BUILTIN, LOW);
    delay(50);
  }
}


void loop() {
 // wait for data from p5 before doing something
 while (Serial.available()) {
   digitalWrite(LED_BUILTIN, HIGH);  // led on while receiving data


   int LED_STATE = Serial.parseInt();
   //int right = Serial.parseInt();
   if (Serial.read() == '\n') {
     digitalWrite(rightLedPin, LED_STATE);
     int sensor2 = analogRead(A1);
     delay(5);
     Serial.print(sensor2);
     Serial.print(',');
     Serial.println('Y');
   }
 }
 digitalWrite(LED_BUILTIN, LOW);
}

 

Week 11: reading response

The shift in approaching disability, as outlined in the text, from a medical model to a social model is indeed intriguing and resonates with a more inclusive and human-centric perspective. The idea that disabilities are not solely medical conditions but are shaped by societal factors opens up new avenues for design solutions. I particularly find the example of eyewear transformation from a medical necessity to a key fashion accessory compelling. The shift from perceiving glasses merely as vision correction tools to considering them as items of clothing aligns with the social model. The recognition of the cultural and fashion aspects of eyewear challenges the conventional view of assistive devices, emphasizing the importance of societal perceptions.

However, I am somewhat uncertain about the notion that design for disability should seamlessly integrate with mainstream design. While collaboration and shared perspectives are undoubtedly valuable, there may be unique challenges and considerations specific to designing for disabilities that require specialized attention. It’s crucial to strike a balance between inclusive design practices and recognizing the distinct needs of individuals with disabilities. The risk of blending the two seamlessly lies in potentially overlooking the specific requirements and experiences of those with disabilities. Designing for disabilities might benefit from a dedicated focus to ensure that the resulting solutions genuinely address the challenges faced by the community.

Week 11 | Serial Communication: Serial Communication Exercises Assignment

Serial Communication Exercises Assignment:

Exercise (1) make something that uses only one sensor  on Arduino and makes the ellipse in p5 move on the horizontal axis, in the middle of the screen, and nothing on arduino is controlled by p5
ellipse(map(alpha, 0, 1023, 0, 640), 80, 80, 80);

Video Demonstration IMG_5539 2

Exercise (2) make something that controls the LED brightness from p5
function keyPressed() {
  
  // set up connection with p5:
  if (key == " ") {
    setUpSerial();
  }
  
  if (key == "1"){
    left = 10;
  }
  
  if (key == "2"){
    left = 100;
  }
  
  if(key == "3"){
    left = 255;
  }
}

Video DemonstrationIMG_5542

Exercise (3) take the gravity wind example  and make it so every time the ball bounces one led lights up and then turns off, and you can control the wind from one analog sensor
P5 CODE

let velocity;
let gravity;
let position;
let acceleration;
let wind;
let drag = 0.99;
let mass = 50;
let isBouncing = 0;

function setup() {
  createCanvas(640, 480);
  textSize(18);

  position = createVector(width / 2, 0);
  velocity = createVector(0, 0);
  acceleration = createVector(0, 0);
  gravity = createVector(0, 0.5 * mass);
  wind = createVector(0, 0);
}

function draw() {
  background(255);

  if (!serialActive) {
    text("Press Space Bar to select Serial Port", 20, 30);
  } else {
    applyForce(wind);
    applyForce(gravity);
    velocity.add(acceleration);
    velocity.mult(drag);
    position.add(velocity);
    acceleration.mult(0);

    ellipse(position.x, position.y, mass, mass);
    if (position.y > height - mass / 2) {
      velocity.y *= -0.9; // A little dampening when hitting the bottom
      position.y = height - mass / 2;
      isBouncing = 1;
    } else {
      isBouncing = 0;
    }
  }
}

function keyPressed() {
  if (key == " ") {
    // important to have in order to start the serial connection!!
    setUpSerial();
  } else if (key == "ENTER") {
    mass = random(15, 80);
    position.y = -mass;
    velocity.mult(0);
  }
}

function readSerial(data) {
  if (data != null) {
    // make sure there is actually a message
    // split the message
    let fromArduino = split(trim(data), ",");
    // if the right length, then proceed
    if (fromArduino.length == 1) {
      // only store values here
      // do everything with those values in the main draw loop
      let potValue = int(fromArduino[0]);
      wind.x = map(potValue, 0, 1023, -1, 1);
    }

    //////////////////////////////////
    //SEND TO ARDUINO HERE (handshake)
    //////////////////////////////////
    let sendToArduino = isBouncing + "\n";
    writeSerial(sendToArduino);
  }
}

function applyForce(force) {
  // Newton's 2nd law: F = M * A
  // or A = F / M
  let f = p5.Vector.div(force, mass);
  acceleration.add(f);
}

ARDUINO CODE

int ledPin = 5;
const int potPin = A1;

void setup() {
  Serial.begin(9600);
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(potPin, INPUT);
  // start the handshake
  while (Serial.available() <= 0) {
    digitalWrite(LED_BUILTIN, HIGH); // on/blink while waiting for serial data
    Serial.println("0,0"); // send a starting message
    delay(300);            // wait 1/3 second
    digitalWrite(LED_BUILTIN, LOW);
    delay(50);
  }
}

void loop() {
  // wait for data from p5 before doing something
  while (Serial.available()) {
    digitalWrite(LED_BUILTIN, HIGH); // led on while receiving data
    digitalWrite(ledPin, LOW);
    int isBouncing = Serial.parseInt();
    if (Serial.read() == '\n') {
      int potValue = analogRead(potPin);
      delay(5);
      Serial.println(potValue);
    }
    // Set LED brightness based on whether bouncing.
    if (isBouncing == 1) {
      digitalWrite(ledPin, HIGH);
    } else {
      digitalWrite(ledPin, LOW);
    }
  }
  digitalWrite(LED_BUILTIN, LOW);
}

Video Demonstration IMG_5610

Week 11 | Creative Reading Reflection: Design Meets Disability

Creative Reading Reflection – Design Meets Disability:

Exploring design is closely tied to limitations. Charles Eames wisely said, “Design depends largely on constraints,” suggesting that constraints can drive innovation. This highlights the importance of context and how limitations can guide creative solutions. The contrast between good and bad design is interesting. Bad design is like a jarring composition with elements that clash, while good design can be subtly suggested. This aligns with the idea that discretion in design, especially for special needs, doesn’t have to be invisible and the discussion on eyewear and fashion shows how positive pre-existing images can shape design considerations. The ongoing debate between functionality and design is captivating that engineers often prioritize functionality, but our love for beauty adds complexity.

Design for disability sparks thought. Why should designs mimic the norm when they can go beyond it? This challenges the suggestions that disability design should envision possibilities beyond social expectations. It calls for a shift in norms and embracing diversity in design. Inclusive design is a crucial theme, balancing functionality and simplicity. It raises ethical questions about the responsibility of designers in creating products that cater to diverse populations.

Design goes beyond just physical things. It includes culture, how we see things, and what society values. This challenges us to think not only about making products but also how we see and value design in our everyday lives. When we embrace inclusive design, we’re moving towards a kinder and fairer future. In this future, creativity has no limits, and everyone can enjoy the advantages of design that thinks about the needs of all users.

Week 11: Reading Response

Graham Pullin’s “Design Meets Disability” is an interesting read, as it pushes the idea of not constraining the design of assistive devices with a utilitarian approach. That is, we should not only focus on the overall function of assistive devices for disabled people, but also focus on the design aspect of it.

This reminds me of an earlier reading we did on the balance of form and function, where different teapots were compared in regard to the utility and aesthetic aspects of their design. I agreed with the author that aesthetic choices enhance the overall experience, even adding to the utility aspect of a design. The same principal applies here.

Take glasses for example. Anyone who’s grown up wearing glasses knows the desire to get the frames that fit you the best. There are two reasons for it. Firstly, why not? The glasses will serve the purpose of making you able to see, whether or not they’re fashionable. So why not get something that you love wearing? The second reason adds on to that, and it’s simply that you’ll feel better about wearing your glasses and actually use them, if they fit you and you like the way they look on you. In that sense, the aesthetic and fashion sense add on to the utility of the pair of glasses because it allows you to not feel hindered or lesser just because you have weaker eyesight. The same principle applies for other disabilities as well. People who have access to customizable prosthetics use them to express themselves and feel much more open about their disability. It gives them an avenue to express themselves and accept themselves.

In embracing the fusion of aesthetics and functionality, we acknowledge that design can be a powerful tool in fostering inclusivity and self-acceptance within the realm of assistive technology.

Week 11 – Reading Reflection

Design Meets Disability

This reading, about how designing for disabilities can change the way we think of design, was extremely well structured and raised many thoughts. Firstly, it was interesting to observe how the evolution of glasses from being perceived as a medical device to a fashion accessory mirrored my personal journey with glasses. I have needed to wear glasses since third grade, and in the first few years I greatly resented them and preferred how I looked without them. My eyes progressively got worse every year, and so I always had to update my glasses. In high school, something shifted and I did not mind much how I looked with glasses anymore, and I began to look forward to the opportunity to get new glasses. As the reading stated, it is having the choice between different options that empowers the consumer to “accessorize” their image. The fact that the accessory is needed to enable human function does not take away from its worth as a fashion statement. Last year I got a new pair of golden framed glasses, and that was the first time I felt happy to be wearing them, as one of my favorite book characters also wears golden framed glasses.

The reading brought up the question of if it is possible to “appropriate” things like eyewear, or in the future, hearing aids and prostheses. Personally, I find it just a tad bit annoying when people wear non-prescription glasses just for the looks, because they have the privilege of not actually needing them to see. In the future, if development in the design of hearing aids follows the trajectory of that of glasses, will people start sporting “hearwear” even if they do not have hearing loss? And how would this be received by Deaf communities? While there is no “community” of people with glasses, there are deaf communities with their own cultures, and so the two situations are not really comparable. And then, what about prostheses?

I also felt that the principle presented in the reading of achieving positive image without invisibility was especially powerful, as it reminded me of discourses within queer history about how the goal should not be to assimilate (into heteronormative culture) in order to gain acceptance, but to have the freedom of visibility without receiving harm for it.

Week 11 – Final Project Idea

Final Project Idea

I have two ideas in consideration for my final project. The first is a physical recreation of the onion-chopping mini-game from Wii Party. When I was a kid, my friends and I would always play Wii Board Game Island, and this was one of my favorite mini-games. The user moves their Wii remote down in a chopping motion, and whoever “chops” the most number of times within the time limit wins.

For an Arduino/P5 recreation, I am imagining a chopping board covered in foil, and a knife made out of metal or wood covered in foil/copper tape, so that whenever the knife comes into contact with the chopping board, a switch is activated (similar to our “creative switch” assignment). There would be two players and two chopping boards hooked up to different pins on the Arduino, and these pins would send signals to the P5 screen, which would be a scoreboard. Every time the switch activates (a person chops once), their score would increase by one. The p5 program would also be running a stopwatch for one minute and beep when the minute is up. One issue is that I don’t know what I would use as the thing to be chopped, because unless I use real knives, which would be too dangerous, it would be impossible to actually cut through much. An alternative is to simply not have any object to be chopped, and to simply erect a picture of the Wii Game next to my setup so that people understand the concept.

My second idea is to make a “psychic hotline”, which would kind of be like these Magic 8 balls,

except that it would be a cardboard phone that is hollow inside, to allow for a servo motor and an attached spinning wheel. The phone buttons would be Arduino buttons, and depending on the last button that the user presses, the spinning wheel would rotate until the designated psychic message shows through a cutout in the cardboard. The whimsy of this project would mostly be the aesthetic and the intricacies of cardboard construction, which I have been enjoying in making my previous projects. P5 would function as a backdrop with twinkling stars, instruct users on which number to dial for which type of psychic question (love, career, self-improvement, etc.) and provide error messages if the user has not inputted the correct phone number. The limitation of this project is that there would only be a few interactions before the user gets bored, because the spinning wheel can only accommodate so many messages.

Week 11 – Serial Communication Exercises

Serial Communication Exercises

  1. Make something that uses only one sensor on Arduino and makes the ellipse in p5 move on the horizontal axis, in the middle of the screen, and nothing on Arduino is controlled by p5:

I kept the Arduino and p5 code from the handshake example intact, and added this line of code in p5 to take the value obtained from the potentiometer to control the x-position of the circle.

// draw a circle, alpha value controls the x-position of the circle
circle(map(alpha, 0, 1023, 0, 640), 240, 50)

2. Make something that controls the LED brightness from p5:

Again using the Arduino and p5 code from the handshake example, I added some code to the “keyPressed” function in p5, so that different values would be sent to the “left” LED in Arduino, changing its brightness.

function keyPressed() {
  
  // set up connection with p5:
  if (key == " ") {
    setUpSerial();
  }
  
  //control the brightness of the LED by sending different values to "left"
  if (key == "1"){
    left = 10;
  }
  
  if (key == "2"){
    left = 100;
  }
  
  if(key == "3"){
    left = 255;
  }
}

Exercise 2 P5 code

3. Take the gravity wind example and make it so every time the ball bounces one led lights up and then turns off, and you can control the wind from one analog sensor:

Video demonstration

I transplanted all the code of the gravity wind example into the handshake example, and then added two bits of code to complete the assignment. The first part sends either a “1” or a “0” to the “left” LED in Arduino to turn on and off the LED when the ball bounces.

//send value to "left" LED in arduino 
   // depending on y-position of ball 
  
  // if y-position is greater than 330, light up the LED
  if(position.y >= 330){
    left = 1;
  }
  
  // if y-position is greater than 335, turn off the LED
  if(position.y <= 335){
    left = 0;
  }

The second bit maps the potentiometer values to 1 and -1, allowing the user to control the wind by turning the potentiometer.

//control wind with potentiometer
wind.x = map(alpha, 0, 1023, -1, 1);

Exercise 3 P5 code

 

Resources:

Izah and Zion’s code helped me in completing this assignment.

Week 11 – Reading Response

Graham Pullin discusses the assistive technology with the respect of aesthetic designs as well as the functionality in the book Design Meets Disability. She talks about the intersection of design and disability, examining how design can be inclusive and accessible to individuals with disabilities.  Importantly, Graham gives a retrospect to how some assistive devices such as glasses have transformed from a mere medical devices to fashionable items and other tensions that exist between design and accessibility. With this, Graham challenges traditional notions of assistive devices and explores the idea that disability should not be viewed solely as a medical problem to be solved but rather as a social and cultural issue that design can address.

For me, this reading is thought-provoking and eye opening. It not only showed me many design examples of daily item, but also inspired me to think about them in the topic of disability. What is so special about disability? How should our designs be adapted to disability? Do they need to look good? Do they need to be simplistic? All these tensions are more complicated when considering the context of disability. Even not in the case of accessibility an disability, the tensions introduced by Graham are worth thinking when concerning good designs. This also reminds me of the previous reading “Do Attractive Things Work Better
. This reading also talks about the relation between aesthetics and functionality. And Graham’s piece seems like an extension to the scope discussed in this reading.  And more significantly, Graham’s discussion reveals an important but usually neglected goal of designs, which is advocating for a more inclusive and accessible world.

Reflection – Week 10

Interaction Design

Bret Victor’s critique of the current state of interaction design grabbed my attention because I hadn’t really delved into thinking deeply about existing interaction designs before, nor had I formed a strong opinion on the matter. According to Victor, the current approach lacks boldness and visionary thinking, urging a shift beyond established norms to cultivate a more ambitious perspective for the future. While I agree with his viewpoint, transitioning from familiar interaction patterns to something entirely different is not a simple task. People need time to adapt to new lifestyles and products, so changing how we interact with technology may require considerable effort and adjustment.

Considering the evolution of current interaction technology, it becomes apparent that what we have today likely originated from visionary ideas but underwent gradual enhancements over time. As I understood it from the subsequent response, Victor’s vision revolves around the concern that contemporary and future technology might limit our mobility. I believe that the trajectory of people’s vision for interactive technology has remained somewhat consistent. Victor’s frustration with incremental changes to existing products resonates with me, as I think we need to strike a balance. Some technologies, like iPads and iPhones, are user-friendly and effective, but there’s a need to transition to more actively interactive technology  and something that involves more of our senses that we are naturally utilizing without fully realizing and without compromising physical health. Achieving this shift would require engaging brainstorming, diverse suggestions, and expertise from various fields to make it both interesting and feasible.