The Schematic
The Implementation
http://youtu.be/c3KD8xtHOTQ
The Code
Ridiculously verbose I know, I'll be making this and a standard alphanumeric set into a library after tweaking it a bit.
[sourcecode language="c"]
int a = 10;
int b = 9;
int c = 12;
int d = 8;
int e = 7;
int f = 5;
int g = 6;
int dp = 11;
void setup(){
Serial.begin(9600);
}
void clearLCD(){
digitalWrite(a,0);
digitalWrite(b,0);
digitalWrite(c,0);
digitalWrite(d,0);
digitalWrite(e,0);
digitalWrite(f,0);
digitalWrite(g,0);
digitalWrite(dp,0);
}
void displayA(){
digitalWrite(f,1);
digitalWrite(e,1);
digitalWrite(g,1);
}
void displayB(){
digitalWrite(a,1);
digitalWrite(f,1);
digitalWrite(e,1);
digitalWrite(d,1);
digitalWrite(g,1);
}
void displayC(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(d,1);
}
void displayD(){
digitalWrite(a,1);
digitalWrite(f,1);
digitalWrite(e,1);
digitalWrite(d,1);
}
void displayE(){
digitalWrite(a,1);
digitalWrite(g,1);
digitalWrite(e,1);
digitalWrite(c,1);
digitalWrite(d,1);
}
void displayF(){
digitalWrite(a,1);
digitalWrite(g,1);
digitalWrite(c,1);
}
void displayG(){
digitalWrite(g,1);
digitalWrite(c,1);
}
void displayH(){
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(g,1);
}
void displayI(){
digitalWrite(g,1);
}
void displayJ(){
digitalWrite(e,1);
digitalWrite(g,1);
digitalWrite(c,1);
digitalWrite(a,1);
}
void displayK(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(d,1);
}
void displayL(){
digitalWrite(e,1);
digitalWrite(g,1);
}
void displayM(){
digitalWrite(f,1);
digitalWrite(g,1);
digitalWrite(b,1);
}
void displayN(){
digitalWrite(e,1);
digitalWrite(f,1);
digitalWrite(a,1);
digitalWrite(b,1);
}
void displayO(){
digitalWrite(f,1);
digitalWrite(e,1);
}
void displayP(){
digitalWrite(a,1);
digitalWrite(f,1);
digitalWrite(g,1);
digitalWrite(c,1);
}
void displayQ(){
digitalWrite(g,1);
digitalWrite(e,1);
digitalWrite(d,1);
digitalWrite(c,1);
digitalWrite(b,1);
}
void displayR(){
digitalWrite(a,1);
digitalWrite(f,1);
digitalWrite(e,1);
digitalWrite(g,1);
}
void displayS(){
digitalWrite(a,1);
digitalWrite(g,1);
digitalWrite(d,1);
}
void displayT(){
digitalWrite(f,1);
digitalWrite(a,1);
}
void displayU(){
digitalWrite(e,1);
digitalWrite(g,1);
digitalWrite(c,1);
}
void displayV(){
digitalWrite(e,1);
digitalWrite(d,1);
digitalWrite(c,1);
}
void displayW(){
digitalWrite(e,1);
digitalWrite(f,1);
digitalWrite(a,1);
digitalWrite(c,1);
digitalWrite(b,1);
}
void displayX(){
digitalWrite(f,1);
digitalWrite(b,1);
digitalWrite(g,1);
digitalWrite(e,1);
digitalWrite(c,1);
}
void displayY(){
digitalWrite(f,1);
digitalWrite(g,1);
digitalWrite(b,1);
digitalWrite(,1);
}
void displayZ(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(g,1);
digitalWrite(e,1);
}
void loop(){
displayA();
delay(500);
clearLCD();
displayB();
delay(500);
clearLCD();
displayC();
delay(500);
clearLCD();
displayD();
delay(500);
clearLCD();
displayE();
delay(500);
clearLCD();
displayF();
delay(500);
clearLCD();
displayG();
delay(500);
clearLCD();
displayH();
delay(500);
clearLCD();
displayI();
delay(500);
clearLCD();
displayJ();
delay(500);
clearLCD();
displayK();
delay(500);
clearLCD();
displayL();
delay(500);
clearLCD();
displayM();
delay(500);
clearLCD();
displayN();
delay(500);
clearLCD();
displayO();
delay(500);
clearLCD();
displayP();
delay(500);
clearLCD();
displayQ();
delay(500);
clearLCD();
displayR();
delay(500);
clearLCD();
displayS();
delay(500);
clearLCD();
displayT();
delay(500);
clearLCD();
displayU();
delay(500);
clearLCD();
displayV();
delay(500);
clearLCD();
displayW();
delay(500);
clearLCD();
displayX();
delay(500);
clearLCD();
displayY();
delay(500);
clearLCD();
displayZ();
delay(500);
clearLCD();
}
[/sourcecode]
No comments:
Post a Comment