Project showcase

TV Tee Shirt © GPL3+

One shirt, thirty-six LEDs, endless possibilities.

  • 9,758 views
  • 3 comments
  • 30 respects

Components and supplies

About this project

So if you check out my profile, you'll see that this is my second project posted to Arduino/Hacker.io, but I've done lots of tinkering with a sensor kit. I'm familiar with working LED matrices and after only being able to control the LEDs in groups of five on my previous wearable project, I wanted to make a wearable with individually controlled LEDs.

Step 1

To begin with, I wanted to do a shirt that would look cool even with the lights off, so using stuff at home (embroidery hoop, sheer fabric from my dress, acrylic paint + fabric medium, a silhouette machine and sticker paper) I DIY screen printed a TV on my shirt.

Step 2

I then used the TV shape as an outline for the area to glue down all my Lilypad LEDS. I glued the Lilypad to the inside of the T-Shirt and then tied conductive threads to each of the 12 ports on the Lilypad I was using, and used fabric glue to keep the wires in place on the outside of the shirt in a way that was aesthetically pleasing.

Step 3

Then I just had to tie all the lights to the "wires", using shrink wrap inside the shirt to keep rows of thread from touching columns of thread. I ran into a problem however, where one light would not turn on, this was a result of two ports having unusually high resistance. I used a multi-meter to discover the problem was at the board, so I ripped the board out and order a new one, only to discover that the board wasn't broken. I tied the board back in, and the two previously "broken" digital ports worked fine. Since tying the board back in however, one OTHER light has been dim. Lesson: Lilypads are very difficult to work with when you have many close threads.

Step 4

I attempted to fix the dim light by retying the wires to the board, but the light is still very dim. Deciding not all the lights could be bright, I sewed on a panel of shimmery grey fabric over the lights, covering up the hardware and giving the TV a 'staticy' look. I uploaded code, and plugged in my power source, a 5v USB portable battery which tucks nicely into my shorts pockets. (Can't wear the shirt with jeans without pockets)

Conclusions

Super happy with how it turned out, even with the stubborn light that's hard to see. The lights are hard to see outside in the summer but it looks great inside, and I can't wait for school to start up to let homecoming be the inspiration for my next project. ✌️

Schematics

Shirt Schematic
This is view of the matrix of lilypad LEDs from the inside of the shirt
Shirt 437ioznjxk

Code

Shirt CodeArduino
I have some basic methods to show off the shirt, a method that will display a randomly generated "equalizer" and randomly modify it for a set duration, and a couple of methods that "scroll" a word across the screen.
It's not well documented but it works.
//Maddy McGee
unsigned long prevMillis = 0;
unsigned long currentMillis = 0;
const int xAxis[6] = {2,3,4,5,6,7};//HIGH is on
const int yAxis[6] = {8,9,10,11,12,13};//LOW is on
void setup() {
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
}

void loop() {
  allOn();
  delay(2000);
  allOff();
  delay(500);
  ex();
  boxesIn(1000);
  boxesOut(500);
  equilizer(100,60);
  //ohio(1000);
  //ohioScroll(250);
  //delay(100);
  //IHeartArt(250);
}

void allOn()
{
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  digitalWrite(8,LOW);
  digitalWrite(9,LOW);
  digitalWrite(10,LOW);
  digitalWrite(11,LOW);
  digitalWrite(12,LOW);
  digitalWrite(13,LOW);
}
void allOff()
{
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);
  digitalWrite(8,HIGH);
  digitalWrite(9,HIGH);
  digitalWrite(10,HIGH);
  digitalWrite(11,HIGH);
  digitalWrite(12,HIGH);
  digitalWrite(13,HIGH);
}

void XYOn(int x, int y)//0 == far left/bottom, 6 == far right/top
{
  for(int cnt = 0; cnt < 6; cnt++)
  {
    if(cnt == x){
      digitalWrite(xAxis[cnt], HIGH);
      }
    else
      digitalWrite(xAxis[cnt], LOW);
  }
  for(int cnt = 0; cnt < 6; cnt++)
  {
    if(cnt == y){
      digitalWrite(yAxis[cnt], LOW);
      }
    else
      digitalWrite(yAxis[cnt], HIGH);
  }
}

void XOn(int x)
{
  for(int cnt = 0; cnt < 6; cnt++)
  {
    if(cnt == x){
      digitalWrite(xAxis[cnt], HIGH);
      }
    else
      digitalWrite(xAxis[cnt], LOW);
  }
}

void YOn(int y)
{
  for(int cnt = 0; cnt < 6; cnt++)
  {
    if(cnt == y){
      digitalWrite(yAxis[cnt], HIGH);
      }
    else
      digitalWrite(yAxis[cnt], LOW);
  }
}

void bihScroll()
{
  allOff();
  //unsigned long start = currentMillis;
  boolean done = false;
  int count = 0;
  while(count<500)//(currentMillis - start < 100)
  {
    count++;
    currentMillis = millis();
    digitalWrite(yAxis[0], LOW);
    digitalWrite(yAxis[1], LOW);
    digitalWrite(yAxis[2], LOW);
    digitalWrite(yAxis[3], LOW);
    digitalWrite(yAxis[4], LOW);
    digitalWrite(yAxis[5], LOW);
    XOn(5);
    delay(1);
  }
  while(count<1000)//(currentMillis - start < 200)
  {
    count++;
    allOff();
    currentMillis = millis();
    if(count%2==0)//(currentMillis%2==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
      XOn(4);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
   }
   while(count<1500)//(currentMillis - start < 300)
   {
    count++;
    allOff();
    if(count%3==0)//(currentMillis%3==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(3);
       
    }
    else if(count%2==0)//(currentMillis%2==0)
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[4], LOW);
    }
   delay(1);
  }
  while(count<2000)
  {
    count++;
    allOff();
    if(count%4==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(2);
    }
    else if(count%3==0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<2500)
  {
    count++;
    allOff();
    if(count%4==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(1);
       XOn(5);
    }
    else if(count%3==0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<3000)
  {
    count++;
    allOff();
    if(count%4==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(0);
       XOn(4);
    }
    else if(count%3==0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<3500)
  {
    count++;
    allOff();
    if(count%4==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(3);
       XOn(5);
    }
    else if(count%3==0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<4000)
  {
    count++;
    allOff();
    if(count%4==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(2);
       XOn(4);
    }
    else if(count%3==0)
    {
      XYOn(5,3);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<4500)
  {
    count++;
    allOff();
    if(count%3==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(1);
       XOn(3);
       XOn(5);
    }
    else if(count%2==0)
    {
      XYOn(4,3);
    }
    else
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<5000)
  {
    count++;
    allOff();
    if(count%3==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(0);
       XOn(2);
       XOn(4);
    }
    else if(count%2==0)
    {
      XYOn(3,3);
    }
    else
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<5500)
  {
    count++;
    allOff();
    if(count%3==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(1);
       XOn(3);
    }
    else if(count%2==0)
    {
      XYOn(2,3);
    }
    else
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<6000)
  {
    count++;
    allOff();
    if(count%2==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(0);
       XOn(2);
    }
    else
    {
      XYOn(1,3);
    }
    delay(1);
  }
  while(count<6500)
  {
    count++;
    allOff();
    if(count%2==0)
    {
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(1);
    }
    else
    {
      XYOn(0,3);
    }
    delay(1);
  }
  while(count<7000)
  {
    count++;
    allOff();
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
       XOn(0);
    delay(1);
  }
  allOff();
  delay(500);
}

void ex()
{
  allOff();
  digitalWrite(xAxis[0],HIGH);
  digitalWrite(xAxis[5],HIGH);
  digitalWrite(yAxis[0],LOW);
  digitalWrite(yAxis[5],LOW);
  delay(300);
  allOff();
  digitalWrite(xAxis[1],HIGH);
  digitalWrite(xAxis[4],HIGH);
  digitalWrite(yAxis[1],LOW);
  digitalWrite(yAxis[4],LOW);
  delay(300);
  allOff();
  digitalWrite(xAxis[2],HIGH);
  digitalWrite(xAxis[3],HIGH);
  digitalWrite(yAxis[2],LOW);
  digitalWrite(yAxis[3],LOW);
  delay(500);
  int count =0;
  while(count<700)
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[1],LOW);
      digitalWrite(yAxis[4],LOW);
    }
    else
    {
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(yAxis[2],LOW);
      digitalWrite(yAxis[3],LOW);
    }
  }
  while(count<2000)
  {
    allOff();
    count++;
    if(count%3==0)
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count %2 ==0)
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[1],LOW);
      digitalWrite(yAxis[4],LOW);
    }
    else
    {
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(yAxis[2],LOW);
      digitalWrite(yAxis[3],LOW);
    }
    delay(1);
  }
}

void boxesIn(int rate)
{
  int count = 0;
  while(count<rate)
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1],LOW);
      digitalWrite(yAxis[2],LOW);
      digitalWrite(yAxis[3],LOW);
      digitalWrite(yAxis[4],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  while(count<(2*rate))
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[1],LOW);
      digitalWrite(yAxis[2],LOW);
      digitalWrite(yAxis[3],LOW);
      digitalWrite(yAxis[4],LOW);
    }
    else
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[1],LOW);
      digitalWrite(yAxis[4],LOW);
    }
    delay(1);
  }
  while(count<(3*rate))
  {
    allOff();
    count++;
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(yAxis[2],LOW);
      digitalWrite(yAxis[3],LOW);
    delay(1);
  }
}

void boxesOut(int rate)
{
  int count = 0;
  while(count<rate)
  {
    allOff();
    count++;
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(yAxis[2],LOW);
      digitalWrite(yAxis[3],LOW);
    delay(1);
  }
  while(count<(2*rate))
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[1],LOW);
      digitalWrite(yAxis[2],LOW);
      digitalWrite(yAxis[3],LOW);
      digitalWrite(yAxis[4],LOW);
    }
    else
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[1],LOW);
      digitalWrite(yAxis[4],LOW);
    }
    delay(1);
  }
  while(count<(3*rate))
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1],LOW);
      digitalWrite(yAxis[2],LOW);
      digitalWrite(yAxis[3],LOW);
      digitalWrite(yAxis[4],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
}

void equilizer(int duration, int times)
{
  int zero, one, two, three, four, five;
  zero = random(1,6);
  one = random(1,6);
  two = random(1,6);
  three = random(1,6);
  four = random(1,6);
  five = random(1,6);
  for(int l = 0; l < times; l++)
  {
  int count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%6 == 0)
    {
      digitalWrite(xAxis[0],HIGH);
      for(int h = 0; h < zero; h++)
      {
        digitalWrite(yAxis[h], LOW);
      }
    }
    else if(count%5 == 0)
    {
      digitalWrite(xAxis[1],HIGH);
      for(int h = 0; h < one; h++)
      {
        digitalWrite(yAxis[h], LOW);
      }
    }
    else if(count%4 == 0)
    {
     digitalWrite(xAxis[2],HIGH);
      for(int h = 0; h < two; h++)
      {
        digitalWrite(yAxis[h], LOW);
      } 
    }
    else if(count%3 == 0)
    {
     digitalWrite(xAxis[3],HIGH);
      for(int h = 0; h < three; h++)
      {
        digitalWrite(yAxis[h], LOW);
      } 
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[4],HIGH);
      for(int h = 0; h < four; h++)
      {
        digitalWrite(yAxis[h], LOW);
      }
    }
    else
    {
     digitalWrite(xAxis[5],HIGH);
      for(int h = 0; h < five; h++)
      {
        digitalWrite(yAxis[h], LOW);
      } 
    }
    delay(1);
  }
  int add = random(-1,2);
  if(add + zero >= 0 && add + zero <6)
  {
    zero+=add;
  }
  add = random(-1,2);
  if(add + one >= 0 && add + one <6)
  {
    one+=add;
  }
  add = random(-1,2);
  if(add + two >= 0 && add + two <6)
  {
    two+=add;
  }
  add = random(-1,2);
  if(add + three >= 0 && add + three <6)
  {
    three+=add;
  }
  add = random(-1,2);
  if(add + four >= 0 && add + four <6)
  {
    four+=add;
  }
  add = random(-1,2);
  if(add + five >= 0 && add + five <6)
  {
    five+=add;
  }
  }
}

void ohio(int duration)
{
  int count = 0;
  while(count < duration)
  {
    allOff();
    count ++;
    if(count%4 == 0)
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%3==0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      XYOn(4,2);
    }
    delay(1);
  }
  allOff();
  delay(10);
   while(count < duration *2)
  {
    allOff();
    count ++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
}

void ohioScroll(int duration)
{
  int count = 0;
  while(count < duration)
  {
    allOff();
    count++;
     digitalWrite(xAxis[5],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[4],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2==0)
    {
     digitalWrite(xAxis[3],HIGH);
     digitalWrite(xAxis[5],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2==0)
    {
     digitalWrite(xAxis[2],HIGH);
     digitalWrite(xAxis[4],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3==0)
    {
     digitalWrite(xAxis[1],HIGH);
     digitalWrite(xAxis[3],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4==0)
    {
     digitalWrite(xAxis[0],HIGH);
     digitalWrite(xAxis[2],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    else if(count%3==0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      XYOn(5,2);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4==0)
    {
     digitalWrite(xAxis[1],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    else if(count%3==0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      XYOn(4,2);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3==0)
    {
     digitalWrite(xAxis[0],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      XYOn(3,2);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3==0)
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      XYOn(2,2);
    }
    delay(1);
  }
   count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3==0)
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(xAxis[5],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      XYOn(1,2);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3==0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(xAxis[4],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      XYOn(0,2);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(xAxis[3],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3==0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[2],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else
    {
     digitalWrite(xAxis[5],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3==0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[1],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else 
    {
     digitalWrite(xAxis[4],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3==0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else if(count%2==0)
    {
      digitalWrite(xAxis[0],HIGH);
      digitalWrite(yAxis[0],LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else 
    {
     digitalWrite(xAxis[3],HIGH);
     digitalWrite(xAxis[5],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else 
    {
     digitalWrite(xAxis[2],HIGH);
     digitalWrite(xAxis[4],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else 
    {
     digitalWrite(xAxis[1],HIGH);
     digitalWrite(xAxis[3],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else 
    {
     digitalWrite(xAxis[0],HIGH);
     digitalWrite(xAxis[2],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2==0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5],LOW);
    }
    else 
    {
     digitalWrite(xAxis[1],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
     digitalWrite(xAxis[0],HIGH);
     digitalWrite(yAxis[1], LOW);
     digitalWrite(yAxis[2], LOW);
     digitalWrite(yAxis[3], LOW);
     digitalWrite(yAxis[4], LOW);
    delay(1);
  }
}

void IHeartArt(int duration)
{
  int count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    digitalWrite(xAxis[5], HIGH);
    digitalWrite(yAxis[0], LOW);
    digitalWrite(yAxis[5], LOW);
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2 == 0)
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2 == 0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%3 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%5 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%4 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%3 == 0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%3 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else 
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%3 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    else if(count%3 == 0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4 == 0)
    {
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%3 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4 == 0)
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%3 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%4 == 0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(xAxis[5], HIGH);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%3 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%3 == 0)
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(xAxis[4], HIGH);
      digitalWrite(yAxis[5], LOW);
    }
    else if(count%2 == 0)
    {
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    else
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(xAxis[3], HIGH);
      digitalWrite(yAxis[5], LOW);
    }
    else 
    {
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2 == 0)
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(xAxis[2], HIGH);
      digitalWrite(yAxis[5], LOW);
    }
    else 
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    if(count%2 == 0)
    {
      digitalWrite(xAxis[1], HIGH);
      digitalWrite(yAxis[5], LOW);
    }
    else 
    {
      digitalWrite(xAxis[0], HIGH);
      digitalWrite(yAxis[0], LOW);
      digitalWrite(yAxis[1], LOW);
      digitalWrite(yAxis[2], LOW);
      digitalWrite(yAxis[3], LOW);
      digitalWrite(yAxis[4], LOW);
      digitalWrite(yAxis[5], LOW);
    }
    delay(1);
  }
  count = 0;
  while(count < duration)
  {
    allOff();
    count++;
    XYOn(0,5);
    delay(1);
  }
}

Comments

Similar projects you might like

DIY Thrust Station

by Vincenzo G.

  • 145 views
  • 0 comments
  • 3 respects

USBcycle: Ride Through Your Virtual World!

Project showcase by Tazling

  • 1,374 views
  • 0 comments
  • 5 respects

Arduino UNO High Precision Counting Scale

Project showcase by Fedeasche

  • 3,593 views
  • 5 comments
  • 19 respects

Mini CNC a Hand-Made Masterpiece

Project showcase by Mr-M

  • 1,143 views
  • 2 comments
  • 9 respects

Arduino Controlled Piano Robot: PiBot

Project tutorial by Jeremy Yoo

  • 1,632 views
  • 0 comments
  • 7 respects

Automation of Railway Models Part 3 - Bidirectional Line

Project showcase by Steve_Massikker

  • 843 views
  • 2 comments
  • 10 respects
Add projectSign up / Login