week10.reading – A Brief Rant on the Future of Interaction Design & Responses and Follow-Up

A Brief Rant on the Future of Interaction Design

In this article, Bret Victor criticizes the mainstream vision for the future of interactive and technological advancements. His main arguments stem from a video created by Microsoft, “Productivity Future Vision,” that demonstrates how people could possibly interact with technology in the future. Mainly, I can understand why Bret Victor finds this vision unnecessary, and “a timid increment from the status quo, and the status quo, from an interaction perspective, is terrible.” Taking a step back to look at the big picture, the current technologies have been mainly developed with one main purpose in mind: simplifying tasks, allowing us to get from point A to point B in a minimal amount of steps. That is most likely why “Pictures behind Glass” became such a prominent theme in 21st-century technology. Using a finger on a small glass display minimizes the distance needed to interact with the GUI, allowing the computer to perform the tasks. Therefore, it is considered efficient.

Being raised in a digital age of technology, my generation had grown up with these “Pictures behind Glass” technologies, and they have become extremely intuitive for us to understand. Bret Victor, on the other hand, grew up in a different era where these technologies have not yet been developed. I believe that is a crucial factor to consider when trying to understand his opinion about the future of interaction design. I agree with a lot of the arguments he makes about how our hands are crucial tools for understanding the world and objects around us and the digital touch displays that we are so used to removing a significant portion of digital interaction. However, it is hard to imagine how one can combine physical response with digital computations in an efficient and effective way. One example of this that I recently saw was a new project on Kickstarter where a company developed a pen that operates just as a normal pen when you write notes. However, simultaneously converts the physical ink into a digital copy to one of your devices. Ultimately, I believe that Bret Victor does make a variety of strong arguments and suggestions as to how future interactive technologies should aim to perform, but I also believe that his vision differs significantly from those of the newer generations.

Responses and Follow-Up

Whilst responding to the most common questions and suggestions about the article, I believe that Bret Victor was able to elaborate on certain aspects of the article that were missing. For instance, he had clarified that the problem isn’t that these superficial ‘touch-screen’ technologies are prominent now, but rather he is worried that if we don’t address the need for more “hands on” interaction, then the future interaction designs will not be up to his ideology of what they should be. And with that, I can agree. Specifically, had had also mentioned the ideology from parents that their children can interact with an iPad but cannot tie their own shoelaces. I believe that this is actually a significant problem that we face in our societies. Each year, children are introduced to these technologies at a younger age than before, and consequently, their brains develop substantially differently from ours. There are two ways to look at it. For instance, if a child is neglected by their parents and is given a device to entertain themselves, the child will consequently search for comfort and entertainment in the digital realm. What makes this scary is that the companies that develop the applications that kids love so much have no interest in providing tools to better educate and help with the healthy mental development of children, but rather all they care about is their annual revenue. This leads to children adopting and forming bad habits through constant device usage and lack of physical hands-on interaction.

I believe that Victor’s responses helped me understand his perspective more thoroughly and consequently agree with his ideas. As humans, we love to simplify and make our daily lives for efficient, from the development of cars to get around faster to the development of modern smartphones to perform the equivalent of hundreds if not thousands of separate tasks from a few decades ago, all with one device. Of course, for mature individuals, these tools can be seen as a blessing in saving our precious and finite time left, but I believe they pose a much greater risk for the generations that are to come after us. As Victor deliberately mentions, our hands allow us to better understand the world around us, and when we teach our young ones to neglect the full potential of their hands and envision a future where even less tactile interaction will be better, I come to realize how unsettling the next decades can be.

Reading Response Week 9 – AakifR

I think that the reading “Making Interactive Art: Set the Stage, Then Shut Up and Listen” captures what all art is about and how all art works regardless of whether it’s explicitly interactive or not. After the artist publishes their work for other people to see, a process of interaction between the artist’s thoughts and the thoughts of the audiences starts to happen. This is where the magic of meaning happens. Each viewer has their own perspective towards anything they encounter and with each interaction a new meaning is formed. Sometimes, the new meanings are quite vastly different than what the artists originally thought of when making the art. For example, the robotic arm that sweeps hydraulic fluid by Sun Yuan and Peng Yu called “Can’t Help Myself” was originally intended to be about migration and sovereignty but viewers largely interpreted it to be about being depressed and trying to hold oneself together.

I think for me personally, I learn a lot and connect a lot of dots while I’m having conversations with people rather than when I’m with myself. So this idea of putting an artwork out there and then let people interact with it and have conversation with it is something that makes a lot of sense to me.  As I think about capstone, I want to integrate more of this two way conversational aspect so that I learn more about myself and ideas and also how other people think about them.

Week 9 Assignment – AakifR

For this week I wanted to experiment with the Ultraviolet Distance Sensor that was provided in the Starter Kit. I hooked it up to the Arduino and then tried to create a sort of system that turns a red light on if the distance of the object becomes too little or too big from the sensor. Some of the applications could be, for example, to alert an automated robot vehicle if it’s getting too close to an obstacle and similarly if it’s moving too far apart.

Video Demonstration:

Code:

// defines pins numbers
const int trigPin = A0;
const int echoPin = A1;

const int pushButton = A2;

const int greenLEDPin = 13;
const int redLEDPin =  12;


// defines variables
long duration;
int distance;
void setup() {
  pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
  pinMode(echoPin, INPUT); // Sets the echoPin as an Input

  pinMode(greenLEDPin, OUTPUT);

  Serial.begin(9600); // Starts the serial communication
}
void loop() {


int buttonState = digitalRead(pushButton);

  if (buttonState == HIGH) {
   
    digitalWrite(greenLEDPin, HIGH);
  }
  else{
    digitalWrite(greenLEDPin, LOW);
  }

// print out the state of the button:
  Serial.println(buttonState);
  delay(1);  // delay in between reads for stability



  // Clears the trigPin
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  // Sets the trigPin on HIGH state for 10 micro seconds
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  // Reads the echoPin, returns the sound wave travel time in microseconds
  duration = pulseIn(echoPin, HIGH);
  // Calculating the distance
  distance = duration * 0.034 / 2;
  // Prints the distance on the Serial Monitor
  Serial.print("Distance: ");
  Serial.println(distance);

  if (distance >= 10 && distance <=  20){
    digitalWrite(redLEDPin, HIGH);
  }
  else{
    digitalWrite(redLEDPin, LOW);
  }

}

 

week9.reading – Physical Computing’s Greatest Hits (and misses) & Making Interactive Art

Physical Computing’s Greatest Hits (and misses)

In this article by Tigoe, a variety of different examples of ‘physical computing’ projects are discussed and lightly analyzed. I believe that this article is particularly useful for us Intro To IM students in order to start thinking about various ideas we might have for our final projects and how we could implement our ideas into action. It is also highly helpful that in the article, Tigoe also provides a simple explanation of how each of the provided examples most likely works.

Additionally, I think the first statement of the article is crucial for individuals to not easily give up on their project when they are just getting started. Tigoe writes, “Sometimes when people learning about physical computing hear that a particular idea has been done before, they give up on it, because they think it’s not original. What’s great about the themes that follow here is that they allow a lot of room for originality.” This statement precisely encourages everyone who is interested in physical computing not to get discouraged just because something has been done before but rather explore the possible options to make it original. As for myself, I have not yet decided on what type of final project I might be making but I will surely use this article as a resource for more ideas and brainstorming.

Making Interactive Art: Set the Stage, Then Shut Up and Listen

In this different article from Tigoe, the presentation of an interactive artwork is discussed. The article is well structured and explains at first the common misconceptions newcomers to the field might face because of what we were taught about art in school. Then the article goes on to discuss a perspective on how an interactive artwork or environment must function. Even though this is subjective to each individual, I believe the provided formula is a great framework for how these types of projects must be structured. This article is highly complementary to the article discussed above, and I believe it gives us a thorough perspective on how we should approach our future projects in interactive media.

What I found interesting, though, is that there are multiple factors that might not have been mentioned. Ultimately, is it accurate to assume that the majority of people will have mixed reaction. As noted in the article, I believe that the context and the environment in which the media is presented is a high contributing factor to the overall experience of the audience. I think that cultural context can have a significant effect on how the installations might be interpreted. This is most likely not the case for us university students as we are highly integrated with our current environment, but for bigger projects, the artists might want to consider how the geographical location might affect the experience they are trying to provide. Nevertheless, I believe that overall this article is highly beneficial for us to understand how we should structure and organized a interactive media project or experience.

Hot or Cold?

Who doesn’t love a classic game of hot or cold? Simple yet so fun and played for generations. Which is exactly why I felt like it was time for an update. Inspired by the apple AirTag and its precision proximity, I created my own little simpler version of it.

Inspiration:

Apple AirTags: What You Need to Know | by Lance Ulanoff | Debugger

 

My version:

In Action:

IMG_9190

 

Process:

Before settling down with this idea as my final one I went through a period of many trial and error as I played around with other sensors and other ideas that unfortunately all failed me somehow but in the end I went back to what I was familiar with and created something that I really love and is fun to play and test its limits with an UltraSonic Sensor.

To make this I first added the different level of closeness LED to resemble the app’s screen and lighting up levels of LED to show how hot or cold you are from the object and then I added the ultrasonic sensor to be able to detect the closeness of the object, following that I added a piezo buzzer to make it give audio feedback as to how close “hot” you are to the object. For the code I just wrote several if else statements that change the LED based on it’s distance and plays a tone on the buzzer and builds up on each other depending on the amount of LED you have on which makes them sound louder.

Code:
// Define the connection pins for the ultrasonic sensor
const int trig = 11;
const int echo = 12;

// Define the pins for the LED indicators
const int LED1 = 5;
const int LED2 = 4;
const int LED3 = 3;
const int LED4 = 2;

// Define the pin for the piezo buzzer
const int piezoPin = A0;

// Variables to store the duration of the echo pulse and the calculated distance
int duration = 0;
int distance = 0;

void setup()
{
  // Set the ultrasonic sensor pins
  pinMode(trig , OUTPUT); // Trigger pin will send the pulse
  pinMode(echo , INPUT);  // Echo pin will receive the pulse

  // Set the LED pins as outputs
  pinMode(LED1 , OUTPUT);
  pinMode(LED2 , OUTPUT);
  pinMode(LED3 , OUTPUT);
  pinMode(LED4 , OUTPUT);

  // Set the piezo buzzer pin as an output
  pinMode(piezoPin, OUTPUT);

  // Start serial communication at 9600 baud rate
  Serial.begin(9600);
}

void loop()
{
  // Trigger the ultrasonic sensor to send a pulse
  digitalWrite(trig , HIGH);
  delayMicroseconds(10); // Ultrasonic pulse is 10 microseconds long
  digitalWrite(trig , LOW);

  // Measure the duration of the incoming echo pulse
  duration = pulseIn(echo , HIGH);
  
  // Calculate the distance based on the duration of the echo pulse
  distance = (duration/2) / 28.5;
  
  // Print the distance to the Serial Monitor
  Serial.println(distance);

  // Light up LED1 and sound buzzer if distance is 10 cm or less
  if (distance <= 10)
  {
    digitalWrite(LED1, HIGH);
    tone(piezoPin, 1000); // Emit a 1000Hz tone
  }
  else
  {
    digitalWrite(LED1, LOW);
    noTone(piezoPin); // Stop the buzzer if condition is not met
  }

  // Light up LED2 and sound buzzer if distance is 30 cm or less
  if (distance <= 30)
  {
    digitalWrite(LED2, HIGH);
    tone(piezoPin, 1000); // Emit a 1000Hz tone
  }
  else
  {
    digitalWrite(LED2, LOW);
    noTone(piezoPin); // Stop the buzzer if condition is not met
  }

  // Light up LED3 and sound buzzer if distance is 50 cm or less
  if (distance <= 50)
  {
    digitalWrite(LED3, HIGH);
    tone(piezoPin, 1000); // Emit a 1000Hz tone
  }
  else
  {
    digitalWrite(LED3, LOW);
    noTone(piezoPin); // Stop the buzzer if condition is not met
  }

  // Light up LED4 and sound buzzer if distance is 60 cm or less
  if (distance <= 60)
  {
    digitalWrite(LED4, HIGH);
    tone(piezoPin, 1000); // Emit a 1000Hz tone
  }
  else
  {
    digitalWrite(LED4, LOW);
    noTone(piezoPin); // Stop the buzzer if condition is not met
  }
}
Future Changes and reflection:

In the future I would love to make it more aesthetic and maybe even be able to have a way to make it detect only something specific by adding a magnet to it and making it only sensitive to that magnet for example but i’m not really sure how feasible that is. I’d also love to add an LCD screen that says how close you are to the object. But overall as a first time working with sensors and Arduino I do think that this is an amazing start and I can’t help but be proud of myself for it especially with the amount of times my circuits failed or the idea just wasn’t it when I was trying out with the other sensors and how frustrating that was to deal with.

 

Week 9: PAY HERE!

CONCEPT:

This week, I chose to work with an ultrasonic distance sensor to create a quirky barcode scanner. Since we still did not cover the sensor in class, I referred to SparkFun reference list and this video to know more about the sensor.

The LED lights light up and the piezo beeps once anything close (within a specific distance) is detected so that it mimicks the scanning of products’ barcodes. A switch button is also there in case the LEDs need to be switched manually (also to meet the requirements).  I handmade a funny setup of a cash register that you can check below.

COMPONENTS:

I used the following elements: BreadBoard/LEDs/Ultrasonic Sensor/Piezo Buzzer/Switch Button/Resistors/Wires/Arduino Uno, to make the following circuit:

The result was this funny looking cash register:

VIDEO:

Here is a video of how it works: cashier

CODE:
//pins numbers
const int trigPin = 9;
const int echoPin = 10;
const int ledPin1 = 11;
const int buzzer = 3;
const int ledPin2 = 6;

//variables
long duration;
int distance;
bool buzzerOn = false;  

void setup() {
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  //to clear trigpin
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);


  //set trigPin on HIGH state for 10 micro seconds
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  //read echoPin & return the sound wave 
  duration = pulseIn(echoPin, HIGH);

  //calculating the distance
  distance = duration * 0.034 / 2;

  if (distance <= 50) {
    tone(buzzer, 2000); //frequency to make buzzer louder
    digitalWrite(ledPin1, HIGH);
    digitalWrite(ledPin2, HIGH);
    buzzerOn = true;  //buzzer is on
  } else {
    if (buzzerOn) {
      noTone(buzzer); 
      buzzerOn = false;  //buzzer off
    }
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, LOW);
//Prints the distance on the Serial Monitor
//Serial.print("Distance: ");
//Serial.println(distance);
  }
 
}

Basically, what’s happening here is that the code uses an ultrasonic sensor to measure distances based on the time it takes for a sound wave to bounce off an object and return. The trigger (trigPin) sends out a short ultrasonic pulse, and the echo (echoPin) detects the reflected pulse. The duration of the pulse’s travel time is then measured, and the distance is calculated based on the speed of sound. If the calculated distance is less than or equal to 50, the code activates the piezo buzzer at a frequency of 2000 and turns on two LEDs to indicate that an object is detected. The `buzzerOn` flag is used to prevent the buzzer from continuously sounding when an object remains within the detection range. When the distance exceeds 50 units, the code turns off the buzzer and the LEDs.

REFLECTION:

The code was the most challenging part in this assignment. I watched few tutorials (including the one referenced) to figure out how to work with the HC-SR04 and how to code the piezo buzzer part so that it is responsive to the distance. Also, I juggled many hardware issues including a short circuit costing me a sensor and almost my laptop plus a lot of damaged wires. Looking at the result now, I think it was worth taking the risk and working with something I never used before.

REFERENCES:

Sparkfun Kit: https://learn.sparkfun.com/resources?page=all

UltraSonic Sensor: https://youtu.be/ZejQOX69K5M?si=t1Vb3VMzbjPW2PnG

 

 

 

Week 9 – Reading Reflection

Making Interactive Art: Set the Stage, Then Shut Up and Listen

While reading the article, I resonated a lot with the author. I do believe that artists should create a space where the mind of a person experiencing the artwork can feel free to explore. By doing so, the artist can not only analyze how interactive and understandable the artwork is, but also take a look at their own work from different perspectives.

The other great point was about not making people adopt the author’s interpretation of the work. I do believe that every artwork should find its own unique place in a person’s mind. And that’s why the idea of artwork having only one interpretation doesn’t make any sense to me.

On the other hand, I do believe that for complex projects, guidance for the user is necessary, even though it can be interpreted as “giving a user a way of doing things”. But otherwise, the initial idea of creating a free space doesn’t see the light because the user may not be able to enter that space.

Physical Computing’s Greatest Hits (and misses)

I really enjoyed the idea described in the first paragraph that it’s worth doing something that has already been done because there’s always room for originality. But I also believe that humans should be inventors, and before pursuing any type of work, think if there’s something more that can be done.

The article gave me ideas that can be used in the projects. I saw most of the ideas mentioned in the article being implemented in real life. Particularly, I see a lot of room for originality in the project involving gloves.

Digital & Analog Sensors

Concept

For this assignment, I thought of making a multipurpose sensor but I decided to create a rough design of a night lamp that has a space touch to it. I used two LEDs, a blue and a yellow one, where the blue was used for the moon and the yellow was used for the sun. For the digital aspect of this assignment, I used a button that turns on the blue light, and when clicked for the second time, the blue light starts to blink as well as the yellow light if it’s on, and when clicked for the third time, the blue light turns off. For the analog aspect, I used the sensor to detect light, so when it’s dark enough or the brightness is below 500, the yellow light turns on, and it can be in blinking mode along with the blue light if the button is clicked. 

Code 

if (isButtonPressed) {
    buttonMode = (buttonMode + 1) % 3;
    isButtonPressed = false;

    switch (buttonMode) {
      case 0: // Off
        analogWrite(BUTTON_LED_PIN, 0);
        break;

      case 1: // On
        analogWrite(BUTTON_LED_PIN, 255);
        break;

      case 2: // Fading
        break;
    }
  }

The overall code was not very challenging, but it’s definitely new to me and  it took me a while to make sure I have my code right so that I could focus on the hardware. I liked this piece of code because I’m using the switch function which really helped me organize what I had in mind. Also, I initially wanted the lights to fade but I need to work on it to figure out why its blinking.

Reflection 

This assignment challenged me to learn more about the bread board and the arduino and how to separate different functions from each other. I started this assignment by experimenting with what I already learned in class and making a few adjustments, and thought of just leaving it as a multipurpose sensor that can be used in a bedroom setting, a museum, or anywhere else, but I wanted it to have some creative aspect to it, and hence, I used whatever tools I had with me to create a rough design of a night lamp.

Video : https://intro.nyuadim.com/wp-content/uploads/2023/11/lampsensors.mp4

Week 9: digital & analog input/output

Concept

For this assignment, I decided to expand upon the concept I previously developed. In the previous assignment, I built a switch that illuminated my drawer upon opening. Given the utilization of sensors in this assignment, I contemplated enhancing the mechanism from a mechanical process to an automated one. The core idea is to enable the LED to deactivate in total darkness, and as the drawer is opened, with increasing light levels, the LED will illuminate.

Code highlight

const int LED_PIN = 9;        // the PWM pin the LED is attached to
const int LIGHT_SENSOR_PIN = A2; // the analog pin the light sensor is attached to
const int BUTTON_PIN = A3;    // the pin where the button is connected
const int EXTRA_LED_PIN = 10; // the pin for the additional LED
int brightness = 0;           // how bright the LED is
int ledState = LOW;           // initial LED state is off
int lastButtonState = LOW;    // previous button state

void setup() {
  pinMode(LED_PIN, OUTPUT);
  pinMode(EXTRA_LED_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT);
  Serial.begin(9600);
}

void loop() {
  int light_value = analogRead(LIGHT_SENSOR_PIN); 
  brightness = map(light_value, 0, 1023, 0, 255); 
  Serial.println(brightness);
  analogWrite(LED_PIN, brightness); // 0-255

  int buttonState = digitalRead(BUTTON_PIN);
  if (buttonState == HIGH && lastButtonState == LOW) {
    // Toggle the LED state
    ledState = (ledState == LOW) ? HIGH : LOW;

    // Update the LED state
    digitalWrite(EXTRA_LED_PIN, ledState);

    // Update the last button state
    lastButtonState = HIGH;
  } else if (buttonState == LOW) {
    lastButtonState = LOW;
  }
}

To meet the second requirement of obtaining input in a digital format, I incorporated a switch that allows the user to control the light, toggling it on or off as needed. This idea materialized during my reflections on the project when I realized one of the limitations of the initial design – it relied on the room’s illumination to function. Hence, the addition of the switch serves as an effective solution to overcome this constraint.

Reflection

Coming up with an idea for this assignment was a bit difficult but I found the process of revisiting and refining an existing idea very satisfying.

The current version kind of contradicts the intial idea but i think it still works out fine.

 

 

week9.assignment – Too Close!

Concept

When we first started working with the Arduino, I was intrigued by learning about how certain sensors work. Last year, I used an Ultrasonic Sensor for an experiment for my physics class, and once I discovered a similar but less advanced sensor in our Sparkfun kit, I was eager to understand how it functions. Additionally, since the assignment required us to use LED, I came up with an interesting idea. Similar to how a park-assist sensor works to determine the distance between the car’s bumper and a wall, I decided to use the sensor to determine how close an object is and consequently alternate the brightness of an LED based on how far away the object is. Since we hadn’t learned about the HC-SR04 distance sensor, I looked through Sparkfun’s guide, where every element of our kit was explained. There, I found a good example of how the sensor functions.

Implementation

Initially, the process seemed quite simple: connect the sensor to the breadboard, use the jumper wires to connect it to the Arduino, and use the information gathered by the sensor to manipulate an LED connected to a PWM pin, which would allow me to use analogWrite. However, as I quickly discovered, it is vital to be precise in every component of the circuit. Accidentally, I managed to overload one of the LEDs I was using, consequently burning it. I am still unsure where the issue was; however, I suspect it could’ve been the cathode of the LED which was very close to the resistor. If it had accidentally touched the starting part of the resistor, the current would jump straight into the LED before it went through the resistor and thus burnt the LED. Nevertheless, apart from this minor issue, everything else worked well and after tinkering around with the code, I was able to produce exactly what I had envisioned. One of the two LEDs was multipurpose. It can be turned on using the button (digital switch) and controlled in a digital fashion. Additionally, that same LED circuit is also connected to a different pin, which allows it to turn on once the distance sensor value exceeds a certain threshold. One other issue I encountered was with converting the data from the analog sensor into understandable units. The example provided by Sparkfun used inches as their units; however, I decided to use a ruler and experiment with the math to adjust the sensor to be accurate using centimeters. Two videos of the working project and the code are below:

Distance Detector Video

Digital Switch

const int ECHO_PIN = 12;       //input, collects data from waves
const int TRIG_PIN = 11;       //output, sends out the waves

const int RED_LED = 8;         // red to light up when objects close
const int YELLOW_LED = 6;      // yellow to fade if object getting further

float distance = 0;            // variable to store distance

void setup() {
  Serial.begin (9600);         // set up a serial connection with the computer

  pinMode(ECHO_PIN, INPUT);    // echo pin measure the duration of pulses coming back from the distance sensor
  pinMode(TRIG_PIN, OUTPUT);   // trigger pin output pulses of electricity

  //set LED pins to output
  pinMode(RED_LED, OUTPUT);
  pinMode(YELLOW_LED, OUTPUT);
  pinMode(PUSH_BUTTON, INPUT_PULLUP);
}

void loop() {
  distance = getDistance();   //variable to store distance measured by the sensor in cm

  Serial.print(distance);     //print the distance that was measured
  Serial.println(" cm");      //print units after the distance

// if conditional to control LED's depending on distance.
  if (5 <= distance && distance <= 30) {
    int brightness = map(distance, 5, 30, 255, 0);
    analogWrite(YELLOW_LED, brightness);
    digitalWrite(RED_LED, LOW);
    Serial.println(brightness);
  } else if (distance < 5) {
    digitalWrite(RED_LED, HIGH);
  } else {
    analogWrite(YELLOW_LED, 0);
    digitalWrite(RED_LED, LOW);
  }
}

float getDistance() {
  float echoTime;                   //variable to store the time it takes for a ping to bounce off an object
  float calculatedDistance;         //variable to store the distance calculated from the echo time

  //send out an ultrasonic pulse that's 10ms long
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  echoTime = pulseIn(ECHO_PIN, HIGH);      //pulsein command to see how long it takes for pulse to bounce back to sensor

  calculatedDistance = echoTime / 55.2;    //calculate  distance of object that reflected the pulse in cm

  return calculatedDistance;               //send back calculated distance 
}
Reflection

Overall, I found this experience to be extremely useful and crucial in understanding how to find information about new sensors and objects I could use for future projects, as well as understanding how to structure the code for the collection of sensor data. I also found it extremely helpful to print out the values of the sensor to help me adjust the math calculations, which is common practice I used in P5JS to determine if everything was working well, and it translates well into the physical computing environment.