Tuesday, March 25, 2008

arduino.prototype_005 = LEDs in separate time

We still have not received the Flexinol yet, so we have focused on the code for this particular prototype with LED lights. 

We were attempting to have the LED lights to go on and off at different rates, allowing for outputs going from synchronized to a more chaotic pattern.

Once the Flexinol is arrived, we will swap the circuit with the one from Prototype 4, where we have connected a series of relays with individual outputs and the LEDs to flexinol wire.




int ledPin13 = 13;
int ledPin12 = 12;
int ledPin11 = 11;

long t;

void setup()
{pinMode(ledPin13, OUTPUT);
pinMode(ledPin12, OUTPUT);
pinMode(ledPin11, OUTPUT);
}

void loop()
{
  t = millis();
  
  if (t % 1000 == 0){
  digitalWrite(ledPin13, HIGH);
  }else{
  digitalWrite(ledPin13, LOW);
  }
  if (t % 2000 == 0){
  digitalWrite(ledPin12, HIGH);
  }else{
  digitalWrite(ledPin12, LOW);
  }
  if (t % 3000 == 0){
  digitalWrite(ledPin11, HIGH);
  }else{
  digitalWrite(ledPin11, LOW);
  }
}


Labels: , ,


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?