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.
Dependencies: mbed MPU6050_ GAMES
Diff: metrix.cpp
- Revision:
- 4:78194ed9ff6b
- Parent:
- 3:7ae3dd76ba0a
- Child:
- 5:616b5894b610
diff -r 7ae3dd76ba0a -r 78194ed9ff6b metrix.cpp
--- a/metrix.cpp Thu Oct 11 03:33:57 2018 +0000
+++ b/metrix.cpp Fri Oct 12 04:03:49 2018 +0000
@@ -93,18 +93,24 @@
mat_act[fila-1]=mat_tmp1[2];
mat_act[fila ]=mat_tmp1[3];
};
+
void correr_fig(){
- char t=1;
- uint8_t correr;
+ uint8_t correr;
+ /*
+ char t=1;
while (t==1 && command.readable()==0){
- wait(0.1);
+ wait_ms(0.1);
t=0;
}
if (command.readable())
correr=command.getc();
else
- correr=0;
+ correr=5;
+ */
+
+ correr=command.getc();
+
if(correr==30) //Arriba, voltear figura.
correr=1;
@@ -115,7 +121,7 @@
correr=3;
if(correr==31) //Bajar la figura.
- correr=4;
+ correr=0;
switch (correr){
@@ -134,15 +140,13 @@
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((mat_tmp[1]==2) &&(mat_tmp[2]==2) && (mat_tmp[3]==2))
- //ncolumna=7;
+ if((mat_tmp[1]!=1) && (mat_tmp[2]!=1) && (mat_tmp[3]!=1)){
+ if((mat_tmp[1]!=3) && (mat_tmp[2]!=3) && (mat_tmp[3]!=3)){
+ if((mat_tmp[1]!=7) && (mat_tmp[2]!=7) && (mat_tmp[3]!=7))
+ ncolumna++;
+ }
}
- if(ncolumna>7)
- ncolumna=7;
+
break; //correr a la Derecha;
case 3:
@@ -150,11 +154,12 @@
if(ncolumna<1)
ncolumna=1;
break; //correr a la izquierda;
-
+ /*
case 4:
cont++;
if(cont>8)cont=8;
break;
+ */
}
}
@@ -213,7 +218,7 @@
void fichas(){
ficha= rand() % 5+1;
- grados= rand() % 4+1;
+ //grados= rand() % 4+1;
ncolumna=4;
}