Advertisement
Kl43z

robot

Oct 23rd, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. sub avanzar(){
  2. OnFwd(OUT_C,50);
  3. OnFwd(OUT_B,40);
  4. }
  5.  
  6.  
  7.  
  8. task main(){
  9. int x=1;
  10. SetSensorSound (IN_2);
  11. SetSensorLight (IN_3);
  12. SetSensorLowspeed (IN_4);
  13.  
  14. while (TRUE){
  15. NumOut(5,5, SENSOR_3); //18-30
  16. if (x%2==1){
  17. Off(OUT_BC);
  18. OnFwd(OUT_C,50);
  19. }
  20. else if (x%2==0){
  21. Off(OUT_BC);
  22. OnFwd(OUT_B,40);
  23. }
  24. x++;
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement