Last assignment, Josh Lopez-Binder

Because my initial idea failed (an attempt to use nitinol muscles to make motion) I made a revision of the last project.  The goal was to make a mechanism that somehow caused a a wave to propagate down a chain. The chain was constructed from links that all had small pegs.  These pegs limited the maximum and minimum angles that the neighboring link could rotate to.

While playing with the chain I found that a curled section could traverse the length of the chain when gravity pulled on it.  To replicated this motion was simple: I attached a motor with a few gears to the first link.  As the link rotates it pulls its neighbors into a curve.  This curve, when it has accumulated enough links and can overcome friction, propagates down the chain, similar to the jacobs ladder toy.





int motor = 13;
int switchPin = 2;

float minTime = 30;
float maxTime = 1000;
int counter = 0;
boolean runMotor = false;

void setup(){
  Serial.begin(9600);
  pinMode(motor, OUTPUT);
  pinMode(switchPin, INPUT);

}

void loop(){
  int switchState;
  switchState = digitalRead(switchPin);
  //currentSwitchVal = digitalRead(switchPin);
  if(switchState == LOW){
    counter ++;
  }else{
    if(counter>minTime && counter<maxTime){
      runMotor = !runMotor;
      counter = 0;
    }
  }

  Serial.println(counter);

  if(runMotor){
    digitalWrite(LED, HIGH);
    digitalWrite(motor,HIGH);
  } else{
    digitalWrite(LED,LOW);
    digitalWrite(motor,LOW);
  }

}

Post a comment