mbedbidos
/
recoge_manzanas_2
Funciona con acelero-metro, falta comunicación y blink.
Revision 1:efcead3fb5eb, committed 2018-11-14
- Comitter:
- jiuk
- Date:
- Wed Nov 14 22:10:24 2018 +0000
- Parent:
- 0:2dabb9782f24
- Commit message:
- Funcional
Changed in this revision
recoge_manzanas.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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);