Thursday 12/10/09
Post date: Dec 10, 2009 5:47:26 PM
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".