The Legend of the LED Rings

Solo Project - Wearable Technology - OCAD University

Project Goal

To create a wearable performance interface using the body as an actuator. This involves constructing an interface with sensors to interact with the outside world using materials that do not require soldering. The project requires documentation of the performance, circuit, and Arduino code.

 

In Depth - Process

/// the blink functions happens AFTER the lightBounce function occurs 
void blink1(){ // this is for the first LED strip 
  Serial.println("blink 1");
  digitalWrite(strip1, HIGH);   // turn the first LED strip on (HIGH is the voltage level)
  delay(250);                       // wait for 250 milliseconds
  digitalWrite(strip1, LOW);    // turn the first LED strip off by making the voltage LOW
  delay(250);                  // wait for 250 milliseconds
  }

void blink2(){ 
  digitalWrite(strip2, HIGH);   // turn the second LED strip on (HIGH is the voltage level)
  delay(100);                       // wait for 100 milliseconds // // get a contrast between fast and slow from led strip 1 - led strip 3 when it runs blink functions 1 after another
  digitalWrite(strip2, LOW);    // turn the second LED strip off by making the voltage LOW
  delay(100);                 // wait for 100 milliseconds
  }

 void blink3(){
  digitalWrite(strip3, HIGH);   // turn the third LED strip on (HIGH is the voltage level)
  delay(250);                       // wait for 250 milliseconds 
  digitalWrite(strip3, LOW);    // turn the third LED strip off by making the voltage LOW
  delay(250);                   // wait for 250 milliseconds
  }


  void lightBounce(){
    Serial.println("lightBounce"); // shows that the function is running
    for (int thisPin = 10; thisPin <=12; thisPin++){
      digitalWrite(thisPin, HIGH); // turn on pin 10, 11, or 12 which corresponds to led strips 1,2, and 3
      delay(delayTime); /// delayTime will be changing as it loops through this function until delayTime < 80 
      digitalWrite(thisPin, LOW);
      delay(delayTime); /// delayTime will be changing as it loops through this function until delayTime < 80 
    }
    
    for (int thisPin = 11; thisPin >=10; thisPin--){
      digitalWrite(thisPin, HIGH); /// from pin 11 =, go back to 10 so only pin 10 gets a double blink to indicate repetition
      delay(delayTime); /// delayTime will be changing as it loops through this function until delayTime < 80 
      digitalWrite(thisPin, LOW); 
      delay(delayTime); /// delayTime will be changing as it loops through this function until delayTime < 80 
    }
  }

  void stripsOff(){ // turn off all of the LED strips
    digitalWrite(strip1, LOW);
    digitalWrite(strip2, LOW);
    digitalWrite(strip3, LOW);
    }
/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink

  Modified by Catherine Xayabanha 2021 

  MODIFICATIONS: 
  Inspired by the Marvel movie, "Shang Chi and the Legend of the Ten Rings". I wanted to fabricate three rings you put on your wrist and you control them using a button that I attatched to a ring
  for easier hold on your fist. Then, when you "punch" a surface (or make contact with the button). The LED rings light up ONE at a time. Due to voltage reasons, it is restricted to this option. 
  I like to think of the alternating lights as the kinetic energy that your hand transfers onto another surface. Then, when you hold the button down or keep holding contact with the surface, the blinking
  speed of the LED strips increase until it reaches a minimum of 80. That's when it will go back to blinking but at a controlled rate. 
  I used the Blink code example to code my LED strips to blink one at a time while I also configured the speed using "delayTime". 
  And for the fabrication, I used a mini breadboard to put my circuit with 3 TIP 120's, 3 1k resistors, 1 10k resistors, 3 blue LED strips, 1 blue big push button. And it connects to two power sources.
  The Arduino and the 9v battery. Thus, making the Arduino portable and easy to hide in your pockets.
  
*/
int strip1 = 10; 
int strip2 = 11;
int strip3 = 12;
int button = 8;
int buttonState = 0;
int delayTime = 200; /// the original value is 200 - this controls speed of blinking

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(button, INPUT);
  pinMode(strip1, OUTPUT);
  pinMode(strip2, OUTPUT);
  pinMode(strip3, OUTPUT);

  for (int thisPin = 10; thisPin <=12; thisPin++){
    pinMode(thisPin, OUTPUT);
    Serial.begin(9600);
    }
}

// the loop function runs over and over again forever
void loop() {
  buttonState = digitalRead(button);
  Serial.println(buttonState);
//  Serial.println(delayTime);

  if(buttonState == LOW){ // if buttonState = 0;
    lightBounce(); // execute lightBounce where it will turn on pin 10 and then pin 11 and then 12
    delayTime -= 20; // gets faster by decreasing 20 to the delayTime 
    Serial.println(delayTime);

    if(delayTime < 80){ // when it reaches the minimum of 80 all of them start blinking again at a controlled rate 1 by 1
      delayTime = 0; 

      blink1();
      blink2();
      blink3();
      blink2();
      }
       
  }else {
    stripsOff(); // all of the strips are turned off or on LOW 
    delayTime = 200; // and we reset the delayTime back to the original value so that when you press the button again you can loop through the entire thing again.
    }
}
 
Previous
Previous

Drawing Journal Series

Next
Next

Momentum Bag