• TasmiahC commented on Glen P Yeldho's instructable Simple Arduino POV :)2 years ago

My full Code:int s=1000;int i;int j;int k;int p;int q;int r;int ZERO[] = {1,1,1,1,1, 1,0,0,0,1, 1,1,1,1,1};int ONE[] = {1,0,0,0,1, 1,1,1,1,1, 0,0,0,0,1};int TWO[] = {1,0,1,1,1, 1,0,1,0,1, 1,1,1,0,1};int THREE[] = {1,0,1,0,1, 1,0,1,0,1, 1,1,1,1,1};int FOUR[] = {1,1,1,0,0, 0,0,1,0,0, 1,1,1,1,1};int FIVE[] = {1,1,1,0,1, 1,0,1,0,1, 1,0,1,1,1};int SIX[] = {1,1,1,1,1, 1,0,1,0,1, 1,0,1,1,1};int SEVEN[] = {1,0,0,0,0, 1,0,0,0,0, 1,1,1,1,1};int EIGHT[] = {1,1,1,1,1, 1,0,1,0,1, 1,1,1,1,1};int NINE[] = {1,1,1,0,1, 1,0,1,0,1, 1,1,1,1,1};int TIMEDOT[] = {0,0,0,0,0, 0,1,0,1,0, 0,0,0,0,0};int* NUMBER[] = {ZERO,ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE};int letterSpace;int dotTime;void setup(){ // setting the ports of the leds to OUTPUT pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); ...

see more »

My full Code:int s=1000;int i;int j;int k;int p;int q;int r;int ZERO[] = {1,1,1,1,1, 1,0,0,0,1, 1,1,1,1,1};int ONE[] = {1,0,0,0,1, 1,1,1,1,1, 0,0,0,0,1};int TWO[] = {1,0,1,1,1, 1,0,1,0,1, 1,1,1,0,1};int THREE[] = {1,0,1,0,1, 1,0,1,0,1, 1,1,1,1,1};int FOUR[] = {1,1,1,0,0, 0,0,1,0,0, 1,1,1,1,1};int FIVE[] = {1,1,1,0,1, 1,0,1,0,1, 1,0,1,1,1};int SIX[] = {1,1,1,1,1, 1,0,1,0,1, 1,0,1,1,1};int SEVEN[] = {1,0,0,0,0, 1,0,0,0,0, 1,1,1,1,1};int EIGHT[] = {1,1,1,1,1, 1,0,1,0,1, 1,1,1,1,1};int NINE[] = {1,1,1,0,1, 1,0,1,0,1, 1,1,1,1,1};int TIMEDOT[] = {0,0,0,0,0, 0,1,0,1,0, 0,0,0,0,0};int* NUMBER[] = {ZERO,ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE};int letterSpace;int dotTime;void setup(){ // setting the ports of the leds to OUTPUT pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); // defining the space between the letters (ms) letterSpace = 4; // defining the time dots appear (ms) dotTime = 3; }void printLetter(int letter[]){ int y; // printing the first y row of the letter for (y=0; y<5; y++) { digitalWrite(y+2, letter[y]); } delay(dotTime); // printing the second y row of the letter for (y=0; y<5; y++) { digitalWrite(y+2, letter[y+5]); } delay(dotTime); // printing the third y row of the letter for (y=0; y<5; y++) { digitalWrite(y+2, letter[y+10]); } delay(dotTime); // printing the space between the letters for (y=0; y<5; y++) { digitalWrite(y+2, 0); } delay(letterSpace);}void loop(){ for (r=0; r<3; r++) { printLetter(NUMBER[r]); q=0; for (q=0; q<10; q++) { printLetter(NUMBER[q]); printLetter(TIMEDOT); p=0; for (p=0; p<6; p++) { printLetter(NUMBER[p]); k=0; for (k=0; k<10; k++) { printLetter(NUMBER[k]); printLetter(TIMEDOT); j=0; for (j=0; j<6; j++) { printLetter(NUMBER[j]); i=0; for (i=0; i<10; i++) { printLetter(NUMBER[i]); delay(s); } } } } } }}

Salam, ur algorithm worked with my device nicely. Iwanted to make a digital clock with this algorithm and that's why in the "void loop()" section I made this modification.void loop(){ for (r=0; r<3; r++) { printLetter(NUMBER[r]); q=0; for (q=0; q<10; q++) { printLetter(NUMBER[q]); printLetter(TIMEDOT); p=0; for (p=0; p<6; p++) { printLetter(NUMBER[p]); k=0; for (k=0; k<10; k++) { printLetter(NUMBER[k]); printLetter(TIMEDOT); j=0; for (j=0; j<6; j++) { printLetter(NUMBER[j]); i=0; for (i=0; i<10; i++) { printLetter(NUMBER[i]); delay(s); } } } } } ...

see more »

Salam, ur algorithm worked with my device nicely. Iwanted to make a digital clock with this algorithm and that's why in the "void loop()" section I made this modification.void loop(){ for (r=0; r<3; r++) { printLetter(NUMBER[r]); q=0; for (q=0; q<10; q++) { printLetter(NUMBER[q]); printLetter(TIMEDOT); p=0; for (p=0; p<6; p++) { printLetter(NUMBER[p]); k=0; for (k=0; k<10; k++) { printLetter(NUMBER[k]); printLetter(TIMEDOT); j=0; for (j=0; j<6; j++) { printLetter(NUMBER[j]); i=0; for (i=0; i<10; i++) { printLetter(NUMBER[i]); delay(s); } } } } } }}But it is not working except with the portion counting for seconds. Can u please help me solving this problem???Thanks