Guest User

Untitled

a guest
Feb 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. int main(int argc, char* argv[])
  2. {
  3. Finch myFinch;
  4.  
  5. while(myFinch.wasTapped()!= '1')
  6. {
  7. if(myFinch.wasShaken())
  8. {
  9. if(myFinch.isBeakDown() == '1')
  10. {
  11. fila.meterFila(0);
  12. }
  13. else if(myFinch.isBeakUp() == '1')
  14. {
  15. fila.meterFila(1);
  16. }
  17. else if(myFinch.isRightWingDown())
  18. {
  19. fila.meterFila(2);
  20. }
  21. else
  22. {
  23. fila.meterFila(3);
  24. }
  25. }
  26.  
  27. while(!fila.filaVacia)
  28. {
  29. switch(fila.observaFila())
  30. {
  31. case '0':
  32. myFinch.setMotors(-200,-200);
  33. break;
  34.  
  35. case '1':
  36. myFinch.setMotors(200,200);
  37. break;
  38.  
  39. case '2':
  40. myFinch.setMotors(150, 250);
  41. break;
  42.  
  43. case '3':
  44. myFinch.setMotors(250, 150);
  45. break;
  46.  
  47. default:
  48. break;
  49. }
  50. fila.sacarFila();
  51. }
  52. }
  53. return 0;
  54. }
Add Comment
Please, Sign In to add comment