Advertisement
Kl43z

ROBOOT

Oct 27th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. sub vuelta(){
  2. Off(OUT_BC);
  3. OnFwd(OUT_B,50);
  4. Wait(1300);
  5. }
  6. sub avanzar(){
  7. OnFwd(OUT_C,30);
  8. OnFwd(OUT_B,20);
  9. }
  10.  
  11.  
  12.  
  13. task main(){
  14. int x=1;
  15. SetSensorSound (IN_2);
  16. SetSensorLight (IN_3);
  17. SetSensorLowspeed (IN_4);
  18.  
  19. while (TRUE){
  20. NumOut(5,5,SensorUS(IN_4));
  21. if (SensorUS(IN_4)<=165){
  22. vuelta();}
  23. else{
  24. if(SENSOR_3<=65){
  25. Off(OUT_BC);
  26. OnFwd(OUT_C,80);
  27.  
  28. }
  29. else {
  30. Off(OUT_BC);
  31. OnFwd(OUT_B,80);
  32. }
  33.  
  34. }
  35.  
  36.  
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement