Skip to content

Instantly share code, notes, and snippets.

@B45i
Created March 20, 2017 12:03
Show Gist options
  • Select an option

  • Save B45i/cb14ed332cc92c4eecfff26758255ce4 to your computer and use it in GitHub Desktop.

Select an option

Save B45i/cb14ed332cc92c4eecfff26758255ce4 to your computer and use it in GitHub Desktop.
int a1,a2,a3,a4,a5, b1,b2,b3,b4,b5, c1,c2,c3,c4,c5, d1,d2,d3,d4,d5, e1,e2,e3,e4,e5, f1,f2,f3,f4,f5, g1,g2,g3,g4,g5, h1,h2,h3,h4,h5 = 0;
int shape [] = {a1,b1,c1,d1,e1,f1,g1,h1, a2,b2,c2,d2,e2,f2,g2,h2, a3,b3,c3,d3,e3,f3,g3,h3, a4,b4,c4,d4,e4,f4,g4,h4, a5,b5,c5,d5,e5,f5,g5,h5};
int income;
int in;
int k ;
boolean seekbar = false;
int out;
int d = false;
int c = false;
int a= false;
int b = false;
int NUMBER9[]={1,1,1,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,1,1,1,1,1,1,1};
int NUMBER8[]={0,1,1,0,1,1,1,0, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 0,1,1,0,1,1,1,0};
int NUMBER7[]={1,0,0,0,0,0,0,0, 1,0,0,0,1,0,0,0, 1,0,0,0,1,0,0,0, 1,0,0,1,1,1,1,1, 1,1,1,0,1,0,0,0};
int NUMBER6[]={1,1,1,1,1,1,1,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,1,1,1};
int NUMBER5[]={1,1,1,1,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,1,1,1};
int NUMBER2[]= {1,0,0,0,0,0,1,1, 1,0,0,0,0,1,0,1, 1,0,0,0,1,0,0,1, 1,0,0,1,0,0,0,1, 0,1,1,0,0,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,0,0,0,0,0, 1,1,1,1,1,1,1,1, 1,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0};
int U[] = {1,1,1,1,1,1,1,0, 0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,1, 1,1,1,1,1,1,1,0};
int V[] = {1,1,1,1,1,1,0,0, 0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,1, 0,0,0,0,0,0,1,0, 1,1,1,1,1,1,0,0};
int W[] = {1,1,1,1,1,1,1,1, 0,0,0,0,0,0,1,0, 0,0,0,0,0,1,0,0, 0,0,0,0,0,0,1,0, 1,1,1,1,1,1,1,1};
int X[] = {1,1,0,0,0,0,1,1, 0,0,1,0,0,1,0,0, 0,0,0,1,1,0,0,0, 0,0,1,0,0,1,0,0, 1,1,0,0,0,0,1,1};
int Y[] = {1,1,0,0,0,0,0,0, 0,0,1,0,0,0,0,0, 0,0,0,1,1,1,1,1, 0,0,1,0,0,0,0,0, 1,1,0,0,0,0,0,0};
int Z[] = {1,0,0,0,0,1,1,1, 1,0,0,0,1,0,0,1, 1,0,0,1,0,0,0,1, 1,0,1,0,0,0,0,1, 1,1,0,0,0,0,0,1};
int* alpha[]= {A,B,C,D,E,F,G,H,I,J,K,L,M,N};//,T,U,V,W,X,Y,Z};
int letterSpace;
int dotTime;
void setup()
{ Serial.begin(115200);
// setting the ports of the leds to OUTPUT
for( int i = 2; i<10 ;i++ )
{ pinMode(i, OUTPUT);
}
// defining the space between the letters (ms)
letterSpace = 3;
// defining the time dots appear (ms)
dotTime =2;
}
void printLetter(int letter[])
{
int y;
// printing the first y row of the letter
for (y=0; y<8; y++)
{
digitalWrite(y+2, letter[y]);
}
delay(dotTime);
// printing the second y row of the letter
for (y=0; y<8; y++)
{
digitalWrite(y+2, letter[y+8]);
}
delay(dotTime);
// printing the third y row of the letter
for (y=0; y<8; y++)
{
digitalWrite(y+2, letter[y+16]);
}
delay(dotTime);
for(y = 0; y<8; y++) {
digitalWrite(y+2, letter[y+24]);
}
delay(dotTime);
for(y = 0; y<8; y++) {
digitalWrite(y+2, letter[y+32]);
}
delay(dotTime);
// printing the sspace between the letters
for (y=0; y<8; y++)
{
digitalWrite(y+2, 0);
}
delay(letterSpace);
}
void loop()
{
if ( Serial.available()) {
income = Serial.read();
switch(income) {
case'*':
seekbar = true;
break;
case'-':
a = false;
b = true;
break;
if(a == false && b == true){
case'A':
shape [0] = 1;
break;
case'B':
shape[1] = 1;
break;
case'C':
shape[2] = 1;
break;
case'D':
shape[3] = 1;
break;
case'E':
shape[4] = 1;
break;
case'F':
shape[5] = 1;
break;
case'G':
shape[6] = 1;
break;
case'H':
shape[7] = 1;
break;
case'I':
shape[8] = 1;
break;
case'J':
shape[9] = 1;
break;
case'K':
shape[10] = 1;
break;
case'L':
shape[11] = 1;
break;
case'M':
shape[12] = 1;
break;
case'N':
shape[13] = 1;
break;
case'O':
shape[14] = 1;
break;
case'P':
shape[15] = 1;
break;
case'Q':
shape[16]= 1;
break;
case'R':
shape[17] = 1;
break;
case'S':
shape[18] = 1;
break;
case'U':
shape[19] = 1;
break;
case'T':
shape[20] = 1;
break;
case'V':
shape[21] = 1;
break;
case'W':
shape[22] = 1;
break;
case'X':
shape[23] = 1;
break;
case'Y':
shape[24] = 1;
break;
case'Z':
shape[25] = 1;
break;
case'1':
shape[26] = 1;
break;
case'3':
shape[27] = 1;
break;
case'2':
shape[28] = 1;
break;
case'4':
shape[29] = 1;
break;
case'5':
shape[30] = 1;
break;
case'6':
shape[31] = 1;
break;
case'7':
shape[32] = 1;
break;
case'8':
shape[33] = 1;
break;
case'9':
shape[34]= 1;
break;
case'b':
shape[35] = 1;
break;
case'a':
shape[36] = 1;
break;
case'c':
shape[37] = 1;
break;
case'd':
shape[38] = 1;
break;
case'e':
shape[39] = 1;
break;
}
case '+':
a = true;
b = false;
break;
case'/':
for(int i = 0; i<41;i++ ){
shape[i+0]= 0;
delay(20);
}
break;
}
}
if( b == true) {
printLetter(shape);
if(seekbar == true){
k = 190 - Serial.parseInt();
delay(k);
}
else { delay(160);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment