that_one_nigga_you_k

parte_de_cima_da_arena.nxc

Jul 6th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. task main(){
  2. SetSensorLowspeed(IN_1);
  3. SetSensorLowspeed(IN_4);
  4. SetSensor(S2, SENSOR_COLORRED);
  5. SetSensor(S3, SENSOR_COLORRED);
  6.  
  7.  
  8. while(true)
  9. {
  10. if(Sensor(IN_2)<=30 && Sensor(IN_3)<=30)
  11. {
  12. OnFwd(OUT_AC, 75);
  13. }
  14.  
  15. else if(SensorUS(IN_1)<10)
  16. {
  17. RotateMotor(OUT_C, 75, 600);
  18. OnRev(OUT_AC, 75);
  19. }
  20.  
  21. else if(SensorUS(IN_4)<7)
  22. {
  23. RotateMotor(OUT_B, 75, 50);
  24. RotateMotor(OUT_A, 75, 600);
  25. OnFwd(OUT_AC, 75);
  26. }
  27. }
  28.  
  29. }
Add Comment
Please, Sign In to add comment