Week 11: Serial Communication

Task 1

Prompt: 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.

Code P5:

let circleX;
function setup() {
    createCanvas(600, 600);
    noFill();
}
function draw() {
     background("rgb(248,238,249)");
  stroke("purple");
 ellipse(map(circleX, 0, 1023, 0, width), height / 2, 100, 100);
   
     if (!serialActive) {
    background("#CE41E6");
    stroke("#white");
    textSize(50);
    text("Press Space Bar to select Serial Port", 20, 30, width - 30, 200);
  }
}
function keyPressed() {
    if (key == " ")
        setUpSerial();
}
function readSerial(data) {
    if (data != null) //
        circleX = int(data);
}            
   

Arduino Code:

int lightPin = A0;  

void setup() {
  Serial.begin(9600);       
  pinMode(lightPin, INPUT);  
}

void loop() {
  int sensorValue = analogRead(lightPin);  
  Serial.println(sensorValue);            
  delay(5);                             
}

Task 2

Prompt: Make something that controls the LED brightness from p5

For this project, I decided to imitate the sun: as the mouse moves from left to right across the screen, the brightness level on the screen and the connected LED both increase.

Code P5:

let ledBrightness = 0;

function setup() {
  createCanvas(600, 400);
  textSize(20);
}

function draw() {
  background(240);

  if (!serialActive) {
    fill(0);
    text("Press SPACE to select serial port", 20, 30);
  } else {
    // Display mapped brightness
    fill(0);
    text("LED Brightness: " + ledBrightness, 20, 30);

    fill(255, 150, 0);
    ellipse(mouseX, height / 2, map(ledBrightness, 0, 255, 10, 100));
  }

  // Update brightness based on mouseX
  ledBrightness = int(map(constrain(mouseX, 0, width), 0, width, 0, 255));

  // Send brightness to Arduino
  if (serialActive) {
    writeSerial(ledBrightness + "\n");
  }
}

function keyPressed() {
  if (key == ' ') {
    setUpSerial(); 
  }
}

Arduino Code:

int ledPin = 9; 
void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);

  while (Serial.available() <= 0) {
    delay(300);
  }
}

void loop() {
  while (Serial.available()) {
    int brightness = Serial.parseInt();
    if (Serial.read() == '\n') {
      brightness = constrain(brightness, 0, 255);
      analogWrite(ledPin, brightness);
    }
  }
}

Task 3:

Prompt: take the gravity wind example (https://editor.p5js.org/aaronsherwood/sketches/I7iQrNCul) 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. 

I connected Arduino to p5.js so the potentiometer controls the wind of the bouncing ball, and whenever the ball hits the ground, the LED blinks. Everything talks to each other through serial communication.

Link to task 3 video 

Code P5:

let velocity;
let gravity;
let position;
let acceleration;
let wind;
let drag = 0.99;
let mass = 50;
let serial;
let connectBtn;
let ledTriggered = false;
function setup() {
  createCanvas(640, 360);
  noFill();
  position = createVector(width / 2, 0);
  velocity = createVector(0, 0);
  acceleration = createVector(0, 0);
  gravity = createVector(0, 0.5 * mass);
  wind = createVector(0, 0);
  // setup serial connection
  serial = createSerial();
  let previous = usedSerialPorts();
  if (previous.length > 0) {
    serial.open(previous[0], 9600);
  }
  connectBtn = createButton("Connect to Arduino");
  connectBtn.position(10, height + 10); // button position
  connectBtn.mousePressed(() => serial.open(9600));
}
function draw() {
  background(255);
  // check if we received any data
  let sensorData = serial.readUntil("\n");
  if (sensorData.length > 0) {
  // convert string to an integer after trimming spaces or newline
    let analogVal = int(sensorData.trim());
    let windForce = map(analogVal, 0, 1023, -1, 1);
    wind.x = windForce; // horizontal wind force
  }
  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;
    if (!ledTriggered) {
      serial.write("1\n");   // trigger arduino LED
      ledTriggered = true;
    }
  } else {
    ledTriggered = false;
  }
}
function applyForce(force) {
  // Newton's 2nd law: F = M * A
  // or A = F / M
  let f = p5.Vector.div(force, mass);
  acceleration.add(f);
}
function keyPressed() {
  if (key === ' ') {
    mass = random(15, 80);
    position.y = -mass;
    velocity.mult(0);
  }
}

Arduino Code:

int ledPin = 9;
void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}
void loop() {
  // send sensor value to p5.js
  int sensor = analogRead(A0);
  Serial.println(sensor);
  delay(100);
  // check for '1' from p5 to trigger LED
  if (Serial.available()) {
    char c = Serial.read();
    if (c == '1') {
      digitalWrite(ledPin, HIGH);
      delay(100);
      digitalWrite(ledPin, LOW);
    }
  }
}

 

Week 11 – Reading Response

My first takeaway is the importance of design for disability support. Prior to the reading, I was not aware that glasses were used as medical prescriptions not long ago (in the 1960s and 1970s), people were stigmatized for the medical model (they were considered to “cause social humiliation”) and that there was a transition to eyeglasses becoming more stylish with new, fashionable glasses. The irony that striking fashion frames are less stigmatizing than pink plastic glasses strikes me. So I thought that what is more visible (such as the striking fashion frame) can be more positively received than what is intended to be visible (pink plastic glasses). But my thought is not fully correct – glasses’ acceptability does not come from directly from its degree of brightness, for its brightness can be to the distaste of certain consumers. Instead of making things more “visible,” I see that the author tries to bring forward the importance of designers in the making of disability support devices. In the design of prosthetic limbs, design engineers are not demanded in a multidisciplinary team of engineers, clinicians, etc. Yet, I see so much potential through the hearing aid designed by Ross LoveGrove for RNID, called The Beauty of Inner Space. Since design can project negative connotation (such as invisibility to project a sense of shame of something to be hidden) or positive connotation, we need designers for people with disabilities to feel more comfortable. With more comfort, it is easier to “wear” than to “use” – also words I took note of with interest – as the former means more closeness to oneself than the latter.

My second takeaway is the importance of design in general, not just for disability. Steve Jobs words about design being not just “what it looks like and feels like” but “how it works” suggest that design is essential, significant and should not be downplayed! It makes sense because of the example of how the design choice of only two options for the iPod shuffle then allows the user to select either playing tracks in the order they were downloaded or in a random order. Two good principles I wish to remember for design in the future are: one, to consider and pursue great cohesion in design between the parts and the whole; two, creating a more accessible design and using simplicity to achieve this.

Final Project Proposal

When I was thinking about the final project my first idea was to make something innovative and playful at the same time. I decided to make a maze solving robot. The robot would solve the maze on its own, but I would make it interactive by allowing the users to set up the maze how they want.

I plan to create the maze out of cardboard to make it easy to transport and not heavy to move around and change between users. I am planning to also mark sport on the bottom to show outlines of where the boxes can be placed. The user will still be able to place the boxes however they want, but this needs to be done to insure the users don’t put the boxes too close or too far apart therefor “confusing” the robot.  To mark these outlines I am planning to simply tape some colored tape on the floor.

The robot will use a DC motor with wheels to move around and would “see” using the ultrasonic distance sensors. Currently I am looking into making the design as wireless as possible in a sense that the robot will be powered using external power like batteries and not be connected to the laptop to allow for better mobility. The batteries are a solution for the power part, but for the p5 code I will have to be connected to my laptop. I am looking into ways to make the Arduino connect to p5 using Bluetooth but if it proves to be too unreliable I will use the cable and figure out how to adjust the mobility based on that.

As for p5js I plan to make a outline of the “map” of the maze. The robot will move around and leave dots or “breadcrumbs” to show the quickest way solve the given way. I think this will give a nice UI to the whole design.

Week 11 – Reading Response

Reading Design Meets Disability made me rethink how we define good design. It is not just about solving problems efficiently, it is also about expression and identity. What I found really interesting was how the glasses were transformed from a medical device to a mainstream fashion statement. It made me wonder if other assistive devices could follow the same path? Should functionality mean sacrificing design? The reading made me realize that design should follow a broader design principle, one that serves everyone better. We shouldn’t focus just on how things work, but how they feel, how they look, and what the y say about the people using them. That is not just assistive design. That is human centered design.

Week 11 – Serial Communication

Task 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

P5js code:

let sensorValue = 0;

function setup() {
  createCanvas(640, 480);
}

function draw() {
  background(220);

  // Map the sensor value (0–1023) to canvas width (0–640)
  let x = map(sensorValue, 0, 1023, 0, width);
  
  // Draw ellipse in center which is moved on the x axis by the potentiometer
  ellipse(x, height / 2, 50, 50);
}

function keyPressed() {
  if (key === ' ') {
    setUpSerial();
  }
}

function readSerial(data) {
  if (data != null) {
    sensorValue = int(trim(data)); 
  }
}

Arduino code:

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

void loop() {
  int sensorValue = analogRead(A0); //read the data from the potentiometer
  Serial.println(sensorValue);      //send it to p5
  delay(20);                        
}
Task 2:
Make something that controls the LED brightness from p5
P5js code:
function setup() {
  createCanvas(640, 480);
  background(0);
}

function draw() {
  background(0);
  
  // Map mouseX to brightness value (0–255)
  let brightness = map(mouseX, 0, width, 0, 255);
  fill(brightness);
  ellipse(mouseX, height / 2, 50, 50);

  // Send to Arduino only if serial is active
  if (serialActive) {
    writeSerial(int(brightness) + '\n');  // Send as string + newline
  }
}

function keyPressed() {
  if (key === ' ') {
    setUpSerial();
  }
}

//need to leave this empty as we are not reading anything from the arduino
function readSerial(data) {
}

Arduino code:

void setup() {
  Serial.begin(9600);
  pinMode(5, OUTPUT);
}

void loop() {
  if (Serial.available()) {
    int brightness = Serial.parseInt();  //read incoming value from p5
    if (Serial.read() == '\n') {
      brightness = constrain(brightness, 0, 255);
      analogWrite(5, brightness);        // set LED brightness
    }
  }
}
Task 3:

Take the gravity wind example (https://editor.p5js.org/aaronsherwood/sketches/I7iQrNCul) 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

P5js code:

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

let sensorValue = 512; // default before Arduino sends anything
let bounced = false;

function setup() {
  createCanvas(640, 360);
  noFill();
  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);

  // Map sensorValue to wind force between -1 and 1
  let windStrength = map(sensorValue, 0, 1023, -1, 1);
  wind.x = windStrength;

  applyForce(wind);
  applyForce(gravity);

  velocity.add(acceleration);
  velocity.mult(drag);
  position.add(velocity);
  acceleration.mult(0);

  ellipse(position.x, position.y, mass, mass);

  // Bounce detection
  if (position.y > height - mass / 2) {
    velocity.y *= -0.9;
    position.y = height - mass / 2;

    if (!bounced) {
      bounced = true;
      if (serialActive) {
        writeSerial("1\n");
      }
    }
  } else {
    bounced = false;
  }
}

function applyForce(force) {
  let f = p5.Vector.div(force, mass);
  acceleration.add(f);
}

function keyPressed() {
  if (key === ' ') {
    setUpSerial();
    position.y = -mass;
    velocity.mult(0);
  }
}

function readSerial(data) {
  if (data != null) {
    sensorValue = int(trim(data));
  }
}

Arduino code:

int ledPin = 5;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  //read potentiometer value
  int sensorValue = analogRead(A0);
  Serial.println(sensorValue);

  //if we receive "1\n" from p5, blink the LED
  if (Serial.available()) {
    int signal = Serial.parseInt();
    if (Serial.read() == '\n' && signal == 1) {
      digitalWrite(ledPin, HIGH);
      delay(100);
      digitalWrite(ledPin, LOW);
    }
  }

  delay(20);
}

Week 11: Final Brainstorming

For my final, I am considering producing an interactive art piece, that expresses some of the growing frustration I have with some of the politics going on back home in the US.

My project is somewhat inspired by what Kyle Adams did for the Lourve Abu Dhabi in the museum takeover day, where he had participants draw art on paper, scanned it, and visualized it all together with a projector. I would like to make something, similar, but more along the lines of a political dialogue, where viewers can write messages. I am also thinking of having them upload portraits, that will be converted to a consistent cartoon-like style for the demo.

The display will be primarily on a laptop or projector (brought by myself), where users can upload their portraits and scans using their phone to a central site. The display will also be interactive, with a control panel tied to the Arduino, which flips through different topical videos.

Week 11 – Reading Response

DESIGN MEETS DISABILITY

This week’s reading was an eye-opener to the interconnectedness of design and disability. It actually got me thinking of some of the very great designs that I encounter often that are solely meant to aid with disability e.g glasses. This affirms the writer’s point that design  depends largely on constraints and that in so many ways disability inspires design. The reading also pointed out some nuanced details concerning disability designs. One, it is noted that a design should aim to enable while attracting minimal or no attention at all. The whole point of design in disability is to close the gap that is between disability and mainstream and therefore when a design attracts too much attention it is very likely to cause stigmatization that undermines the whole goal of the design. Nonetheless, the discretion is at the danger of sending out the message that disability is something to be ashamed of. Therefore to help strike a balance between discretion and attention the writer speaks of how fashion and medical designs have just done so. For instance, just like glasses have evolved from being disability designs to fashion designs, other medical designs should aim at seeking the perspective of the fashion designers and not be too focused on discretion. More confident and less discrete designs will help in promoting a positive image for disability. Also design for disability should aim for social inclusivity and reduced mediocrity in order to remove barriers that cause stigmatization. Additionally, with reference to James Lecker who manufactures furniture for children with cerebral palsy. He states that a furniture design needs to be so complicated such that it intimidates children and their friends therefore beating the whole point of social integration.

Week 11: Serial Communication

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
We use the LDR reading to change the wind direction and move the ball horizontally. When the LDR reading is less than 600, the ball moves to the left, otherwise it moves to the right.
let rVal = 0;
let alpha = 255;
let left = 0; // True (1) if mouse is being clicked on left side of screen
let right = 0; // True (1) if mouse is being clicked on right side of screen
let velocity;
let gravity;
let position;
let acceleration;
let wind;
let drag = 0.99;
let mass = 50;

function setup() {
  createCanvas(640, 480);
  textSize(18);
  noFill();
  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() {
  // one value from Arduino controls the background's red color
  background(255);
  applyForce(wind);
  applyForce(gravity);
  velocity.add(acceleration);
  velocity.mult(drag);
  position.add(velocity);
  acceleration.mult(0);
 
  // make everything black
  fill(0,0,0);
 
  // draw bounce ball
  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;
  }

  // horizontal ellipse -- goes across screen based on potentiometer
  circle(map(alpha, 0, 1023, 0, width), height/2, 100);
 
  if (!serialActive) {
    text("Press Space Bar to select Serial Port", 20, 30);
  } else {
    text("Connected", 20, 30);
   

    // Print the current values
    text('light sensor = ' + str(rVal), 20, 50);
    text('potentiometer = ' + str(alpha), 20, 70);
  }

  // bar graph for analog LED
  rect(width-50,0,50,right);
 
  // wind -- change wind direction based on light sensor
  if (rVal < 600){
    wind.x=-1;
  }
  if (rVal > 600){
    wind.x=1;
  }
}

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

// This function will be called by the web-serial library
// with each new *line* of data. The serial library reads
// the data until the newline and then gives it to us through
// this callback function
function readSerial(data) {
  ////////////////////////////////////
  //READ FROM ARDUINO HERE
  ////////////////////////////////////

  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 == 2) {
      // only store values here
      // do everything with those values in the main draw loop
     
      // We take the string we get from Arduino and explicitly
      // convert it to a number by using int()
      // e.g. "103" becomes 103
      rVal = int(fromArduino[0]);
      alpha = int(fromArduino[1]);
    }

    //////////////////////////////////
    //SEND TO ARDUINO HERE (handshake)
    //////////////////////////////////
    let sendToArduino = left + "," + right + "\n";
    writeSerial(sendToArduino);
  }
}
2. make something that controls the LED brightness from p5
Pressing on the left side of the screen increases the LED brightness, and pressing on the right side dims it.
let rVal = 0;
let alpha = 255;
let left = 0; // True (1) if mouse is being clicked on left side of screen
let right = 0; // True (1) if mouse is being clicked on right side of screen
let velocity;
let gravity;
let position;
let acceleration;
let wind;
let drag = 0.99;
let mass = 50;

function setup() {
  createCanvas(640, 480);
  textSize(18);
  noFill();
  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() {
  // one value from Arduino controls the background's red color
  background(255);
  applyForce(wind);
  applyForce(gravity);
  velocity.add(acceleration);
  velocity.mult(drag);
  position.add(velocity);
  acceleration.mult(0);
 
  // make everything black
  fill(0,0,0);
 
  // draw bounce ball
  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;
  }
 
  // horizontal ellipse -- goes across screen based on potentiometer
  circle(map(alpha, 0, 1023, 0, width), height/2, 100);
 
  if (!serialActive) {
    text("Press Space Bar to select Serial Port", 20, 30);
  } else {
    text("Connected", 20, 30);
   

    // Print the current values
    text('light sensor = ' + str(rVal), 20, 50);
    text('potentiometer = ' + str(alpha), 20, 70);
  }

  // click on one side of the screen, LED will get brighter
  // click on the other side, LED will dim
  if (mouseIsPressed) {
    if (mouseX <= width / 2) {
      if (right < 255) {
        right++;
      }
    } else {
      if (right > 0) {
        right--;
      }
    }
  }
  // bar graph for analog LED
  rect(width-50,0,50,right);
}

function keyPressed(){

  if (keyCode==ENTER){
    position.y=-mass;
    velocity.mult(0);
  }
  if (key == " ") {
    // important to have in order to start the serial connection!!
    setUpSerial();
  }
}

// This function will be called by the web-serial library
// with each new *line* of data. The serial library reads
// the data until the newline and then gives it to us through
// this callback function
function readSerial(data) {
  ////////////////////////////////////
  //READ FROM ARDUINO HERE
  ////////////////////////////////////

  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 == 2) {
      // only store values here
      // do everything with those values in the main draw loop
     
      // We take the string we get from Arduino and explicitly
      // convert it to a number by using int()
      // e.g. "103" becomes 103
      rVal = int(fromArduino[0]);
      alpha = int(fromArduino[1]);
    }

    //////////////////////////////////
    //SEND TO ARDUINO HERE (handshake)
    //////////////////////////////////
    let sendToArduino = left + "," + right + "\n";
    writeSerial(sendToArduino);
  }
}
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
Set left = 0 or left = 1 depending on the y position of the ball to turn off/on the LED.
let rVal = 0;
let alpha = 255;
let left = 0; // True (1) if mouse is being clicked on left side of screen
let right = 0; // True (1) if mouse is being clicked on right side of screen
let velocity;
let gravity;
let position;
let acceleration;
let wind;
let drag = 0.99;
let mass = 50;

function setup() {
  createCanvas(640, 480);
  textSize(18);
  noFill();
  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() {
  // one value from Arduino controls the background's red color
  background(255);
  applyForce(wind);
  applyForce(gravity);
  velocity.add(acceleration);
  velocity.mult(drag);
  position.add(velocity);
  acceleration.mult(0);
 
  // make everything black
  fill(0,0,0);
 
  // draw bounce ball
  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;
  }
 
  // if ball touches ground, make LED light
  if (position.y >= height-mass/2-10) {
    // light up LED if ball touch ground
    left = 1;  
  }
  else {
    left = 0;
  }

  // horizontal ellipse -- goes across screen based on potentiometer
  circle(map(alpha, 0, 1023, 0, width), height/2, 100);
 
  if (!serialActive) {
    text("Press Space Bar to select Serial Port", 20, 30);
  } else {
    text("Connected", 20, 30);
   

    // Print the current values
    text('light sensor = ' + str(rVal), 20, 50);
    text('potentiometer = ' + str(alpha), 20, 70);
  }
}

function keyPressed(){

  if (keyCode==ENTER){
    position.y=-mass;
    velocity.mult(0);
  }
  if (key == " ") {
    // important to have in order to start the serial connection!!
    setUpSerial();
  }
}

// This function will be called by the web-serial library
// with each new *line* of data. The serial library reads
// the data until the newline and then gives it to us through
// this callback function
function readSerial(data) {
  ////////////////////////////////////
  //READ FROM ARDUINO HERE
  ////////////////////////////////////

  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 == 2) {
      // only store values here
      // do everything with those values in the main draw loop
     
      // We take the string we get from Arduino and explicitly
      // convert it to a number by using int()
      // e.g. "103" becomes 103
      rVal = int(fromArduino[0]);
      alpha = int(fromArduino[1]);
    }

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

arduino

// Week 11.2 Example of bidirectional serial communication

// Inputs:
// - A0 - sensor connected as voltage divider (e.g. potentiometer or light sensor)
// - A1 - sensor connected as voltage divider 
//
// Outputs:
// - 2 - LED
// - 5 - LED

int leftLedPin = 2;
int rightLedPin = 5; // analog

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 left = Serial.parseInt();
    int right = Serial.parseInt();
    if (Serial.read() == '\n') {
      digitalWrite(leftLedPin, left);
      analogWrite(rightLedPin, right);
      int sensor = analogRead(A0);
      delay(5);
      int sensor2 = analogRead(A1);
      delay(5);
      Serial.print(sensor);
      Serial.print(',');
      Serial.println(sensor2);
    }
  }
  digitalWrite(LED_BUILTIN, LOW);
}

Week 10 – Reading Response

THE FUTURE OF INTERACTION DESIGN

A very timely article especially with the current pace of technological advancement. I totally agree with Bret Victor that interaction finds its truest meaning when the capabilities of human beings are amplified through the tools/invention used to make work easier. These tools are meant to make work easier and not to do away with it altogether. I think with the growing technological development drawing a line between increasing efficiency and reducing tactility is becoming harder by the day. Interaction at least as I know it has to involve meaning back and forth engagement between the tool and the user. Therefore designers should refrain from “doing everything” for the user in the name of increasing efficiency but like Bret has committed to his readers they should start thinking about how to increase the interaction experience of the users and making them become more aware of their capabilities in an efficient way and not the opposite. As Bret puts it in his follow up article; we need to aim for “dynamic mediums that we can see, feel, and manipulate”

 

week 11 reading

I just finished reading Design Meets Disability and, wow—what a refreshing shift in perspective. It challenges everything we’ve come to expect from “assistive design” by flipping the script. Instead of treating disability like a design problem that needs to be hidden, it shows how disability can be a source of creative inspiration. And honestly? It makes a pretty solid case for how mainstream design could learn a thing or two from the constraints imposed by disability.

Take that story about the Eames leg splint—can we talk about that for a second? The Eameses didn’t just design a medical device; they pioneered a new design language that ended up defining modern furniture. It’s wild to think that something as utilitarian as a leg splint could evolve into the iconic curves of a Herman Miller chair. That’s not a compromise—that’s a catalyst. It really gets you wondering: how many other innovations have quietly come out of necessity, only to reshape entire industries?

Another thing I loved was how the book dives into the tension between discretion and fashion. Like, who decided that disability needs to be hidden or minimized? Why can’t prosthetic limbs be fabulous? Why can’t hearing aids make a statement? Glasses managed to pull off that transformation—from stigmatized medical device to full-blown fashion accessory. So why are we still designing hearing aids in pink plastic that’s supposed to “blend in” but somehow stands out even more?

And then there’s Aimee Mullins. Her whole vibe completely shatters the binary between function and beauty. Carved wooden legs, eerie glass ones, high-performance carbon fiber? She’s not trying to pass as non-disabled. She’s owning her prosthetics as fashion, as identity, as self-expression. It’s empowering. And her attitude—“Discreet? I want off-the-chart glamorous”—is a mic-drop moment if I’ve ever seen one.

I think what stuck with me most is this: the book isn’t just saying “include disabled people in design.” It’s saying, redefine what design even means. Stop treating it as an afterthought. Don’t just add designers to the team—let them help write the brief. Start at the source, not the symptoms.

Because here’s the truth: we all want beautiful, functional, human-centered design. Whether we’re “disabled” or not, we benefit from objects that are thoughtfully made, intuitively used, and culturally resonant. That’s not niche—that’s universal.

So yeah, Design Meets Disability isn’t just about disability. It’s about dignity, diversity, and damn good design.