Advertisement
Kl43z

ROBOT CP PERFECTO

Oct 23rd, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. sub avanzar(){
  2. OnFwd(OUT_C,30);
  3. OnFwd(OUT_B,20);
  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);
  16. if(SENSOR_3<=30){
  17. Off(OUT_BC);
  18. OnFwd(OUT_C,60);
  19.  
  20. }
  21. else {
  22. Off(OUT_BC);
  23. OnFwd(OUT_B,60);
  24.  
  25.  
  26. }
  27.  
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement