int colAnodes[] = {27,33,39};
int rowCathodes[] = {43,45,49};
unsigned long showATime = millis() + 1000;
unsigned long showMTime = millis() + 2000;
unsigned long showHTime = millis() + 3000;
boolean letters[3][3][3] = {
{
{0,1,1},
{1,1,0},
{0,1,1}
},
{
{1,1,1},
{1,1,0},
{1,1,1}
},
{
{1,1,1},
{0,1,0},
{1,1,1}
}
};
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
for(int pointer = 0; pointer <= (sizeof(colAnodes) / sizeof(colAnodes[0]))-1 ;pointer ++){
pinMode(colAnodes[pointer],OUTPUT);
}
for (int pointer = 0; pointer <= (sizeof(rowCathodes) / sizeof(rowCathodes[0]))-1;pointer ++){
pinMode(rowCathodes[pointer], OUTPUT);
digitalWrite(rowCathodes[pointer], HIGH);
}
for(int letterpointer = ; letterp)
Serial.print(letters[0][0][0]);Serial.print(letters[0][1][0]);Serial.println(letters[0][2][0]);
Serial.print(letters[0][0][1]);Serial.print(letters[0][1][1]);Serial.println(letters[0][2][1]);
Serial.print(letters[0][0][2]);Serial.print(letters[0][1][2]);Serial.println(letters[0][2][2]);
}
void loop() {
//LEDs for making an "A" shape
if(millis() < showATime){
//lightLED(0,0);
// lightLED(0,1);
// lightLED(0,2);
// lightLED(1,0);
// lightLED(1,1);
//lightLED(1,2);
//lightLED(2,0);
// lightLED(2,1);
// lightLED(2,2);
}
//if((millis() > showATime) && (millis() < showMTime)){
//LEDs for making an "M" shape
// lightLED(0,0);
// lightLED(0,1);
// lightLED(0,2);
// lightLED(1,0);
// lightLED(1,1);
//lightLED(1,2);
// lightLED(2,0);
// lightLED(2,1);
// lightLED(2,2);
// }
//if((millis() > showMTime) && (millis() < showHTime)){
//LEDs for making an "H" shape
// lightLED(0,0);
// lightLED(0,1);
// lightLED(0,2);
// //lightLED(1,0);
// lightLED(1,1);
// //lightLED(1,2);
// lightLED(2,0);
// lightLED(2,1);
// lightLED(2,2);
//}
if (millis() > showHTime){
showATime = millis() + 1000;
showMTime = millis() + 2000;
showHTime = millis() + 3000;
}
}
void lightLED(int col, int row){
for(int pointer = 0; pointer <= (sizeof(colAnodes) / sizeof(colAnodes[0]))-1;pointer ++){
digitalWrite(colAnodes[pointer], LOW);
}
for (int pointer = 0; pointer <= (sizeof(rowCathodes) / sizeof(rowCathodes[0]))-1;pointer ++){
digitalWrite(rowCathodes[pointer], HIGH);
}
digitalWrite(colAnodes[col], HIGH);
digitalWrite(rowCathodes[row], LOW);
}