Animated Display

Friday 12/11/09

posted Dec 14, 2009, 9:30 AM by Unknown user

    Today we found out that the timing was the factor.  If it's short enough it will overlap two codes, if it's too short it will light up more lights than we need.  This leaves a small window of time, so small it's too difficult to be able to light what we want up. 

Thursday 12/10/09

posted Dec 10, 2009, 9:47 AM by Unknown user

Today Joe tried to light the rest of the letter A in class by adding more code to what was already there this is how our code looks right now:

int an[] = {11,12,13,11,12,13,10,13,10,12,10,11,10,9,9,11,12,9,8,11,8,10,8,9,8,7,9,7,10,7,7,11,12,7,13,7};
int ca[] = {12,11,11,13,13,12,13,10,12,10,11,10,9,10,11,9,9,12,11,8,10,8,9,8,7,8,7,9,7,10,11,7,7,12,7,13};
int array [6][6]=
{
  {0,1,2,3,4,5},
  {6,7,8,9,10,11},
  {12,13,14,15,16,17},
  {18,19,20,21,22,23},
  {24,25,26,27,28,29},
  {30,31,32,33,34,35},
};
int a = 13;
int b = 12;
int c = 11;
int d = 10;
int e = 9;
int f = 8;
int g = 7;
int y = 0;
int t = 1000;
int i = 1000;
int u = 400;

void setup(){
for (int pin =7; pin<=13; pin++)
{
  pinMode(pin,INPUT);
}
}
void led21() {
  for (int y =0; y <= 100; y=y+1)
    {
    pinMode (an[array[2][1]], OUTPUT);
    pinMode (ca[array[2][1]], OUTPUT);
    digitalWrite(an[array[2][1]], HIGH);
    digitalWrite(ca[array[2][1]], LOW);
    delayMicroseconds(t);
    digitalWrite(an[array[2][1]], LOW);
    digitalWrite(ca[array[2][1]], LOW);
    pinMode (an[array[2][1]], INPUT);
    pinMode (ca[array[2][1]], INPUT);
    } 
}
void led22() {
  for (int y =0; y <= 100; y=y+1)
    {
    pinMode (an[array[2][2]], OUTPUT);
    pinMode (ca[array[2][2]], OUTPUT);
    digitalWrite(an[array[2][2]], HIGH);
    digitalWrite(ca[array[2][2]], LOW);
    delayMicroseconds(t);
    digitalWrite(an[array[2][2]], LOW);
    digitalWrite(ca[array[2][2]], LOW);
    pinMode (an[array[2][2]], INPUT);
    pinMode (ca[array[2][2]], INPUT);
    }
}
    void led23() {
  for (int y =0; y <= 100; y=y+1)
    {
    pinMode (an[array[2][3]], OUTPUT);
    pinMode (ca[array[2][3]], OUTPUT);
    digitalWrite(an[array[2][3]], HIGH);
    digitalWrite(ca[array[2][3]], LOW);
    delayMicroseconds(t);
    digitalWrite(an[array[2][3]], LOW);
    digitalWrite(ca[array[2][3]], LOW);
    pinMode (an[array[2][3]], INPUT);
    pinMode (ca[array[2][3]], INPUT);
    }
    }
    void led24() {
  for (int y =0; y <= 100; y=y+1)
    {
    pinMode (an[array[2][4]], OUTPUT);
    pinMode (ca[array[2][4]], OUTPUT);
    digitalWrite(an[array[2][4]], HIGH);
    digitalWrite(ca[array[2][4]], LOW);
    delayMicroseconds(t);
    digitalWrite(an[array[2][4]], LOW);
    digitalWrite(ca[array[2][4]], LOW);
    pinMode (an[array[2][4]], INPUT);
    pinMode (ca[array[2][4]], INPUT);
    }
    }
    void led25() {
  for (int y =0; y <= 100; y=y+1)
    {
    pinMode (an[array[2][5]], OUTPUT);
    pinMode (ca[array[2][5]], OUTPUT);
    digitalWrite(an[array[2][5]], HIGH);
    digitalWrite(ca[array[2][5]], LOW);
    delayMicroseconds(t);
    digitalWrite(an[array[2][5]], LOW);
    digitalWrite(ca[array[2][5]], LOW);
    pinMode (an[array[2][5]], INPUT);
    pinMode (ca[array[2][5]], INPUT);
    }
    }
    void led30() {
  for (int y =0; y <= 100; y=y+1)
    {
    pinMode (an[array[3][0]], OUTPUT);
    pinMode (ca[array[3][0]], OUTPUT);
    digitalWrite(an[array[3][0]], HIGH);
    digitalWrite(ca[array[3][0]], LOW);
    delayMicroseconds(t);
    digitalWrite(an[array[3][0]], LOW);
    digitalWrite(ca[array[3][0]], LOW);
    pinMode (an[array[3][0]], INPUT);
    pinMode (ca[array[3][0]], INPUT);
    }
    }
    void led32() {
  for (int y =0; y <= 100; y=y+1)
    {
    pinMode (an[array[3][2]], OUTPUT);
    pinMode (ca[array[3][2]], OUTPUT);
    digitalWrite(an[array[3][2]], HIGH);
    digitalWrite(ca[array[3][2]], LOW);
    delayMicroseconds(t);
    digitalWrite(an[array[3][2]], LOW);
    digitalWrite(ca[array[3][1]], LOW);
    pinMode (an[array[3][2]], INPUT);
    pinMode (ca[array[3][2]], INPUT);
    }
    }

void loop()
  {
    pinMode (ca[34], OUTPUT);
    pinMode (an[34], OUTPUT);
    pinMode (an[32], OUTPUT);
    pinMode (an[31], OUTPUT);
    pinMode (an[26], OUTPUT);
    pinMode (an[24], OUTPUT);
    digitalWrite (ca[34], LOW);
    digitalWrite (an[34], HIGH);
    digitalWrite (an[32], HIGH);
    digitalWrite (an[31], HIGH);
    digitalWrite (an[26], HIGH);
    digitalWrite (an[24], HIGH);
    delayMicroseconds(t);
    pinMode (an[31], INPUT);
    pinMode (an[26], INPUT);
    pinMode (an[24], INPUT);
    digitalWrite (ca[34], HIGH);
    digitalWrite (an[34], LOW);
    digitalWrite (an[32], LOW);
    delayMicroseconds(t);
    pinMode (an[34], INPUT);
    pinMode (an[32], INPUT);
    pinMode (ca[34], INPUT);
    for (int y=0; y<=100; y= y+1){
  led30();
  led32();
  led21();
  led22();
  led23();
  led24();
  led25();
}
}

 I couldn't understand why only the last two rows for the letter "A" were lighting up instead of the entire letter as well as why the delay is not short enough to make it look like at least the left half of the letter "A".  time had ran out before I had time to find the culprit of this phenomenon.  Maybe tomorrow we will finally be done with lighting the letter "A".

Wednesday 12/9/09

posted Dec 9, 2009, 9:28 AM by Unknown user   [ updated Dec 9, 2009, 9:11 AM by Unknown user ]

YESTERDAY
We attempted to light two segments of multiple LED combinations with a single microsecond of delay to give the appearance of both being lit up at the same time. Due to pins set as outputs in between the LEDs we were trying to light, other LEDs lit up even though the code was not designed to power those LEDs. An example of this would be setting 11 to high and 8 to low and then 13 to high and 7 to low. Besides lighting up these two LEDs, you would also light up LED 13,8. (code for this would be:
int an[] = {11,12,13,11,12,13,10,13,10,12,10,11,10,9,9,11,12,9,8,11,8,10,8,9,8,7,9,7,10,7,7,11,12,7,13,7};
int ca[] = {12,11,11,13,13,12,13,10,12,10,11,10,9,10,11,9,9,12,11,8,10,8,9,8,7,8,7,9,7,10,11,7,7,12,7,13};

int a = 13;
int b = 12;
int c = 11;
int d = 10;
int e = 9;
int f = 8;
int g = 7;
int y = 0;
int t = 1;

void setup(){
for (int pin =7; pin<=13; pin++)
{
  pinMode(pin,INPUT);        //sets pins 7-13 as inputs
}
}

void loop() {
pinMode(an[34], OUTPUT);     //sets pin 13 as an output
pinMode(an[31], OUTPUT);     //sets pin 11 as an output
pinMode(ca[34], OUTPUT);     //sets pin 7 as an output
pinMode(ca[25], OUTPUT);     // sets pin 8 as an output
digitalWrite(an[34], HIGH);       //sets pin 13 to high
digitalWrite(an[31], HIGH);       //sets pin 11 to high
digitalWrite(ca[34], LOW);        //sets pin 7 to low
digitalWrite(ca[25], LOW);        //sets pin 7 to low
}

TODAY
In an attempt to fix this problem (which I am assuming is caused by Joe's segment of code), I will be adding on to my code with similar code to light up more LEDs. My code uses one pin set at low to act as the ground for multiple pins set to high which should prevent light up extra pins. Another way to avoid it might be to use one high pin to multiple low pins (exactly what I told Joe to try). So by using a combination of these segments of code, it should be possible to light up letters without them blinking due to the numerous delays. Based on the how the code below continued to light up other LEDs, I changed the timing from microseconds to seconds. When I changed the timing, the other LEDs turned off, so I concluded that as the timing reduced the code must be infringing on the lighting sequences.

int an[] = {11,12,13,11,12,13,10,13,10,12,10,11,10,9,9,11,12,9,8,11,8,10,8,9,8,7,9,7,10,7,7,11,12,7,13,7};
int ca[] = {12,11,11,13,13,12,13,10,12,10,11,10,9,10,11,9,9,12,11,8,10,8,9,8,7,8,7,9,7,10,11,7,7,12,7,13};
int array [6][6]=
{
  {0,1,2,3,4,5},
  {6,7,8,9,10,11},
  {12,13,14,15,16,17},
  {18,19,20,21,22,23},
  {24,25,26,27,28,29},
  {30,31,32,33,34,35},
};
int a = 13;
int b = 12;
int c = 11;
int d = 10;
int e = 9;
int f = 8;
int g = 7;
int y = 0;
int t = 1000;
int i = 1000;
int u = 400;

void setup(){
for (int pin =7; pin<=13; pin++)
{
  pinMode(pin,INPUT);
}
}

void loop()
  {
    pinMode (ca[34], OUTPUT);
    pinMode (an[34], OUTPUT);
    pinMode (an[32], OUTPUT);
    pinMode (an[31], OUTPUT);
    pinMode (an[26], OUTPUT);
    pinMode (an[24], OUTPUT);
    digitalWrite (ca[34], LOW);
    digitalWrite (an[34], HIGH);
    digitalWrite (an[32], HIGH);
    digitalWrite (an[31], HIGH);
    digitalWrite (an[26], HIGH);
    digitalWrite (an[24], HIGH);
    delayMicroseconds(t);
    pinMode (an[31], INPUT);
    pinMode (an[26], INPUT);
    pinMode (an[24], INPUT);
    digitalWrite (ca[34], HIGH);
    digitalWrite (an[34], LOW);
    digitalWrite (an[32], LOW);
    delayMicroseconds(t);
    pinMode (an[34], INPUT);
    pinMode (an[32], INPUT);
    pinMode (ca[34], INPUT);
    delayMicroseconds(t);
  }














1-3 of 3