TriOmega
Published

Interruption Binder

A binder for women to protest how much they get interrupted during conversations.

IntermediateShowcase (no instructions)28
Interruption Binder

Story

Read more

Code

InterruptionBinder.ino

Arduino
#include <Adafruit_CircuitPlayground.h>

#define CAP_THRESHOLD 700                                     //Sensitivity of Capactive Touch
#define DEBOUNCE 5000                                         //Global Value for Post Action Delay

int interruptionCount = 0;
int lightValue = 0;

boolean capButton(uint8_t pad) {                              //Function that returns whether the foil button is touched
  if (CircuitPlayground.readCap(pad) > CAP_THRESHOLD) {
    return true;  
  } else {
    return false;
  }
}

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

void loop() {
  if (capButton(1)) {                                         //If touch is detected, gives a notification to serial monitor,--
      Serial.println("Touched.");                             //--increments interruption count, and shows how many interruptions there has been
      interruptionCount++;
      Serial.print("Interruptions: ");
      Serial.print(interruptionCount);
      Serial.println();
      delay(DEBOUNCE);
  }

  lightValue = CircuitPlayground.lightSensor();               //Light senor input
  Serial.println(lightValue);                                 //Light value serial output

  if (lightValue >= 15){                                      //If light is detected, hence the binder has been opened, begins playing--
    for(int i = 0; i < interruptionCount; i++){               //--an annoying sound for each interruption that was endured
      CircuitPlayground.playTone(200, 300);
      CircuitPlayground.playTone(900, 600);
      delay(1000);
    }
    interruptionCount = 0;                                    //Resets interruption count to 0 after sounds have been listed off
    while(true){                                              //While loop that keeps touches from being detected and immediately playing until--
      delay(DEBOUNCE);                                        //--the binder has been closed again
      if (CircuitPlayground.lightSensor() == 0) {
        break;
      }
    }
  }
}
  

Credits

TriOmega
4 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.