What’s Your Level?

Where are we going? Where are we coming from? Being able to let go and lose control important, especially during times in which there is a lot of political and social pressure. The desire for control is a root cause to much of the power struggle in the world. Simplicity can be found in the smallest of tasks, processes which give us the illusion of control, little moments of victory. Keeping track of how much one has achieved isn’t healthy, scoring yourself only builds higher walls. As tempting as it is to yearn for the comfort of control, it is important to find that same comfort in being out of balance.

What little tweak, in retrospect, would’ve changed the direction entirely? This is an opportunity for you to reflect on your creative and technical growth through the project, and think about what growth you want to aim for next. This shouldn’t be a recital of your process, but rather a meaningful consideration of what you experienced during the creation of your piece, 2–4 paragraphs in length.

  • The part of this project that was most intuitive for me was the physical construction of the ramp. The code and electronics were where I struggled most. I learned a lot about working with photoresistors/making my own break beam sensor. I struggled a lot with getting everything to function properly. I think I am slowly building a sort of intuition for working with electronics which I am happy about.
  • The most challenging part of all this was planning out the construction of the ramp (even though it turned out to be the easiest part for me) as well as the combination of the electronics and the structure. The main worry I had was that the ramp would flex as someone was on it, causing the lasers to automatically move, no longer sending the beam straight to the sensors. There was no issue with that.
  • Unfortunately the biggest mistake I made was not predicting the amount of space I would need to speed up to the ramp in order to make it to the top. At such a slow speed it is difficult to balance and the slope is pretty harsh coming up the ramp.

/*
What's Your Level?
Julita Przybylska
This code controls the LEDs and Motor through singals picked up by the pins connected to the photorestistors. Low readings cause the the score to go up as well as affecting the amount the wheel spins. High readings mean that there is not skater present.
Digital Pins correspond to the lasers and LEDs
Analog pins correspond to the photoresistors
*/
#include <AccelStepper.h>

const int STEP_PIN = 12; // A4988 "STEP" pin wired to Arduino pin 2 (you can change this)
const int DIR_PIN = 13; // A4988 "DIRECTION" pin wired to Arduino pin 3 (you can change this)

// make an AccelStepper motor object. "myMotor" can be any name you'd like.
AccelStepper myMotor(1, STEP_PIN, DIR_PIN);

const int photo1 = A0;
const int photo2 = A1;
const int photo3 = A2;
const int photo4 = A3;
const int photo5 = A4;

const int light = 500;

const int led1 = 7;
const int led2 = 8;
const int led3 = 9;
//const int led4 = 10;
const int led5 = 11;

bool skaterPresent = false;
unsigned long timer = 0;

unsigned long score = 0;

void setup() {
  // put your setup code here, to run once:
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  //pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);

  myMotor.setMaxSpeed(1000); // measured in steps per second
  myMotor.setAcceleration(500); // measured in steps per second squared
  Serial.begin(9600);

}
/*
  checking for a break beam bright or dark analog read
  if dark, then this means that something is blocking the beam and points are added to total score,
          if highest score is reached the motor spins 5 rotations, otherwise moves incrimentally
  if bright, then this means that the light is reaching the photoresistor
*/
void loop() {
  // put your main code here, to run repeatedly:
  //sense photo values
  int beam1 = analogRead(photo1);
  int beam2 = analogRead(photo2);
  int beam3 = analogRead(photo3);
  int beam4 = analogRead(photo4);
  int beam5 = analogRead(photo5);

  //decision; 0-1023
  //if a high value is read, add a value to total points and move motor to new position
    int motorPos = 0;
  int light1 = LOW;
  int light2 = LOW;
  int light3 = LOW;
  //int light4 = LOW;
  int light5 = LOW;

  if (millis() - timer >= 60000 && skaterPresent == true) {
    skaterPresent = false;
    motorPos = 0;
    if (score > 0) {
      light1 = LOW;
      light2 = LOW;
      light3 = LOW;
      //light4 = LOW;
      light5 = LOW;
      delay(800);
      light1 = HIGH;
      light2 = HIGH;
      light3 = HIGH;
      //light4 = HIGH;
      light5 = HIGH;
      score -= 1;
      delay(800);
    }
    delay(5000);
    score = 0;
  }

  if (beam1 < light) {
    if (skaterPresent == false) {
      skaterPresent = true;
      timer = millis();
    }
    score += 1;
    motorPos = 40;
    light1 = HIGH;
  }

  if (beam2 < light) {
    score += 2;
    motorPos = 80;
    light1 = HIGH;
    light2 = HIGH;
  }
  if (beam3 < light) {
    score += 3;
    motorPos = 120;
    light1 = HIGH;
    light2 = HIGH;
    light3 = HIGH;
  }
  /*
  if (beam4 < light) {
    score += 4;
    motorPos = 160;
    light1 = HIGH;
    light2 = HIGH;
    light3 = HIGH;
    //light4 = HIGH;
  }
  */
  if (beam5 < light) {
    score += 5;
    motorPos = 1000;
    light1 = HIGH;
    light2 = HIGH;
    light3 = HIGH;
    //light4 = HIGH;
    light5 = HIGH;
  }

  //do
  if (skaterPresent == true) {
    digitalWrite(led1, light1);
    digitalWrite(led2, light2);
    digitalWrite(led3, light3);
    //digitalWrite(led4, light4);
    digitalWrite(led5, light5);
    myMotor.moveTo(motorPos);
    myMotor.run();
  }

  Serial.println((String)"light values: " + beam1 + ", " + beam2 + ", " + beam3 + ", " + beam4 + ", " + beam5 + "\tmotorPos: " + motorPos);
  //Serial.println((String)"score: " + score);
}

 

Process: