Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of METRIX by
Diff: metrix.cpp
- Revision:
- 1:bd308ee8776e
- Parent:
- 0:2b55edb1057b
- Child:
- 2:fc251f89bd1b
diff -r 2b55edb1057b -r bd308ee8776e metrix.cpp --- a/metrix.cpp Mon Oct 01 15:34:36 2018 +0000 +++ b/metrix.cpp Tue Oct 02 17:51:50 2018 +0000 @@ -110,6 +110,10 @@ break; //Girar la figura; case 2: ncolumna++; + if(ncolumna>6){ + if(((mat_tmp[2]==3) && (mat_tmp[3]==6)) || (mat_tmp[2]==7) || (mat_tmp[3]==7)) + ncolumna=6; + } if(ncolumna>7) ncolumna=7; break; //correr a la Derecha; @@ -123,7 +127,7 @@ } -void imp_mat(uint8_t *temp){ //se genera la variable global cont. +void imp_mat(uint8_t *temp){ //se genera la variable global cont. mat_tmp1[0]=(mat_tmp[0]+ mat_act[cont-3]); mat_tmp1[1]=(mat_tmp[1]+ mat_act[cont-2]); mat_tmp1[2]=(mat_tmp[2]+ mat_act[cont-1]); @@ -131,7 +135,7 @@ sendSPI(cont-3,mat_tmp1[0]); sendSPI(cont-2,mat_tmp1[1]); sendSPI(cont-1,mat_tmp1[2]); - sendSPI(cont ,mat_tmp1[3]); //pasa de i+2 a i+1 + sendSPI(cont ,mat_tmp1[3]); //pasa de i+2 a i+1 wait_ms(VEL); } @@ -156,7 +160,7 @@ cop_mat(1,3,3,FIG_ALL,columna); if(grados==4) cop_mat(5,6,2,FIG_ALL,columna); - break; //2: I; + break; case 4: if(grados==1) cop_mat(5,3,2,FIG_ALL,columna); //4: T; @@ -186,14 +190,20 @@ test(); borrar(); while(1){ - fichas(); + fichas(); buscar_fil(); - for (cont=0;cont<=fila;cont++){ - correr_fig(); - dibujar(ficha,grados,ncolumna); - buscar_fil(); - imp_mat(mat_tmp); - } + cont=0; + while (cont<=fila){ + correr_fig(); + dibujar(ficha,grados,ncolumna); + buscar_fil(); + imp_mat(mat_tmp); + //probador bugs + uint8_t correr=command.getc(); + if(correr==31) //Arriba, voltear figura. + cont++; + command.printf("\n4- Cont: %d",cont); + } guardar_mat(); } } \ No newline at end of file