mbedbidos
/
recoge_manzanas_presentacion
correccion spi
Diff: recoge_manzanas.cpp
- Revision:
- 1:efcead3fb5eb
- Parent:
- 0:2dabb9782f24
- Child:
- 2:484928b9a5b5
diff -r 2dabb9782f24 -r efcead3fb5eb recoge_manzanas.cpp --- a/recoge_manzanas.cpp Fri Nov 09 12:49:54 2018 +0000 +++ b/recoge_manzanas.cpp Wed Nov 14 22:10:24 2018 +0000 @@ -109,6 +109,10 @@ fila=MIN; sendSPI(fila-1,0); break; + + case 0: + fila; + break; } } @@ -122,29 +126,7 @@ //command.printf("Gyroscope: \t X= %f, \t Y= %f, \t Z=%f \n", gyro[0],gyro[1],gyro[2]); wait(DEL); - /* - char t=1; - while (t==1 && command.readable()==0){ - wait_ms(0.1); - t=0; - } - if (command.readable()){ - if(acc[0]<4) - correr=28; - if(acc[0]<-4) - correr=29; - if(acc[1]<4) - correr=30; - if(acc[1]<-4) - correr=31; - - //com_tar.putc(correr); - wait_ms(100); - } - - correr=command.getc(); - */ int giro=3; if(acc[0]>giro) //eje x derecha correr=29; @@ -154,6 +136,8 @@ correr=30; else if(acc[1]<-giro) //eje y abajo correr=31; + else + correr=0; // revisar_mov(correr); //wait (DEL); command.printf("\n correr:\n %d",correr);