Anthony & Erin’s Skill Review

In our BioDesign experiment, we are interested in the fashion theme. More specifically, we want to tackle the problem that runners and cyclists have about running at night. They are hard to see, and reflective tape is not always very effective.

Our solution was to follow the bioluminescent design of a Comb Jellyfish. These creatures have comb-like cilia to help them move, scattering light in straight lines down their bodies.

jellygif

To mimic this, we created a pressure sensor hooked to a row of LEDs. When pressed, the LEDs would flash in a row. Let go, and the LEDs shut off.

Essentially, the runners can be seen but also be stylish. It works for the jellies in the deep, dark portions of the ocean!

Here is our code:


int left = A0;
int right = A1;

int led1 = A2;
int led2 = A3;
int led3 = A4;
int led4 = A5;
int led5 = A6; 
int led6 = A7;

int valueLeft, mapLeft;
int valueRight, mapRight;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);

  pinMode(left, INPUT);
  pinMode(right, INPUT);

  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
  pinMode(led6, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:

  valueLeft = analogRead(left);
  valueRight = analogRead(right);
  Serial.print(valueLeft);
  Serial.print("\t");
  Serial.println(valueRight);

  mapLeft = map(valueLeft, 0, 300, 255, 0);

  //Serial.println(mapLeft);

  delay(1000);

  if (valueLeft < 100)
    fromLeft();

  if(valueRight > 1000)
    fromRight();

}

void fromLeft(){

  analogWrite(led1, 255);
  delay (200);
  analogWrite(led1,0);
  analogWrite(led2, 255);
  delay (200);
  analogWrite(led2, 0);
  analogWrite(led3, 255);
  delay (200);
  analogWrite(led3,0);
  analogWrite(led4,255);
  delay (200);
  analogWrite(led4, 0);
  analogWrite(led5, 255);
  delay(200);
  analogWrite(led5, 0);
  analogWrite(led6, 255);
  delay (200);
  analogWrite(led6, 0);

}

void fromRight(){

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s