### Animated Display Subscribe to posts

#### 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 ={  {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], OUTPUT);    pinMode (ca[array], OUTPUT);    digitalWrite(an[array], HIGH);    digitalWrite(ca[array], LOW);    delayMicroseconds(t);    digitalWrite(an[array], LOW);    digitalWrite(ca[array], LOW);    pinMode (an[array], INPUT);    pinMode (ca[array], INPUT);    }  }void led22() {  for (int y =0; y <= 100; y=y+1)    {    pinMode (an[array], OUTPUT);    pinMode (ca[array], OUTPUT);    digitalWrite(an[array], HIGH);    digitalWrite(ca[array], LOW);    delayMicroseconds(t);    digitalWrite(an[array], LOW);    digitalWrite(ca[array], LOW);    pinMode (an[array], INPUT);    pinMode (ca[array], INPUT);    }}    void led23() {  for (int y =0; y <= 100; y=y+1)    {    pinMode (an[array], OUTPUT);    pinMode (ca[array], OUTPUT);    digitalWrite(an[array], HIGH);    digitalWrite(ca[array], LOW);    delayMicroseconds(t);    digitalWrite(an[array], LOW);    digitalWrite(ca[array], LOW);    pinMode (an[array], INPUT);    pinMode (ca[array], INPUT);    }     }    void led24() {  for (int y =0; y <= 100; y=y+1)    {    pinMode (an[array], OUTPUT);    pinMode (ca[array], OUTPUT);    digitalWrite(an[array], HIGH);    digitalWrite(ca[array], LOW);    delayMicroseconds(t);    digitalWrite(an[array], LOW);    digitalWrite(ca[array], LOW);    pinMode (an[array], INPUT);    pinMode (ca[array], INPUT);    }    }    void led25() {  for (int y =0; y <= 100; y=y+1)    {    pinMode (an[array], OUTPUT);    pinMode (ca[array], OUTPUT);    digitalWrite(an[array], HIGH);    digitalWrite(ca[array], LOW);    delayMicroseconds(t);    digitalWrite(an[array], LOW);    digitalWrite(ca[array], LOW);    pinMode (an[array], INPUT);    pinMode (ca[array], INPUT);    }    }    void led30() {  for (int y =0; y <= 100; y=y+1)    {    pinMode (an[array], OUTPUT);    pinMode (ca[array], OUTPUT);    digitalWrite(an[array], HIGH);    digitalWrite(ca[array], LOW);    delayMicroseconds(t);    digitalWrite(an[array], LOW);    digitalWrite(ca[array], LOW);    pinMode (an[array], INPUT);    pinMode (ca[array], INPUT);    }    }    void led32() {  for (int y =0; y <= 100; y=y+1)    {    pinMode (an[array], OUTPUT);    pinMode (ca[array], OUTPUT);    digitalWrite(an[array], HIGH);    digitalWrite(ca[array], LOW);    delayMicroseconds(t);    digitalWrite(an[array], LOW);    digitalWrite(ca[array], LOW);    pinMode (an[array], INPUT);    pinMode (ca[array], INPUT);    }    }void loop()   {    pinMode (ca, OUTPUT);    pinMode (an, OUTPUT);    pinMode (an, OUTPUT);    pinMode (an, OUTPUT);    pinMode (an, OUTPUT);    pinMode (an, OUTPUT);    digitalWrite (ca, LOW);    digitalWrite (an, HIGH);    digitalWrite (an, HIGH);    digitalWrite (an, HIGH);    digitalWrite (an, HIGH);    digitalWrite (an, HIGH);    delayMicroseconds(t);    pinMode (an, INPUT);    pinMode (an, INPUT);    pinMode (an, INPUT);    digitalWrite (ca, HIGH);    digitalWrite (an, LOW);    digitalWrite (an, LOW);    delayMicroseconds(t);    pinMode (an, INPUT);    pinMode (an, INPUT);    pinMode (ca, 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 ]

 YESTERDAYWe 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, OUTPUT);     //sets pin 13 as an outputpinMode(an, OUTPUT);     //sets pin 11 as an outputpinMode(ca, OUTPUT);     //sets pin 7 as an outputpinMode(ca, OUTPUT);     // sets pin 8 as an outputdigitalWrite(an, HIGH);       //sets pin 13 to highdigitalWrite(an, HIGH);       //sets pin 11 to highdigitalWrite(ca, LOW);        //sets pin 7 to lowdigitalWrite(ca, LOW);        //sets pin 7 to low}TODAYIn 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 ={  {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, OUTPUT);    pinMode (an, OUTPUT);    pinMode (an, OUTPUT);    pinMode (an, OUTPUT);    pinMode (an, OUTPUT);    pinMode (an, OUTPUT);    digitalWrite (ca, LOW);    digitalWrite (an, HIGH);    digitalWrite (an, HIGH);    digitalWrite (an, HIGH);    digitalWrite (an, HIGH);    digitalWrite (an, HIGH);    delayMicroseconds(t);    pinMode (an, INPUT);    pinMode (an, INPUT);    pinMode (an, INPUT);    digitalWrite (ca, HIGH);    digitalWrite (an, LOW);    digitalWrite (an, LOW);    delayMicroseconds(t);    pinMode (an, INPUT);    pinMode (an, INPUT);    pinMode (ca, INPUT);    delayMicroseconds(t);  }

1-3 of 3