that_one_nigga_you_k

Untitled

Jun 6th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. task main()
  2. {
  3. SetSensor(S1, SENSOR_COLORBLUE);
  4. SetSensor(S2, SENSOR_COLORBLUE);
  5. //white==48; apenas para decorar
  6. // black==18;
  7. //green==18;
  8.  
  9. while(true)
  10. {
  11.  
  12. if(Sensor(IN_1)>30 && Sensor(IN_2)>30) // ao ver branco, andar pra frente
  13.  
  14. OnFwd(OUT_AC, 65);
  15. }
  16.  
  17.  
  18. if(Sensor(IN_1)<30) // sensor 2, ao ver preto, desacelera lado DIREITO do robô
  19. {
  20. OnFwd(OUT_A, 10);
  21. OnFwd(OUT_C, 50);
  22. }
  23.  
  24. if(Sensor(IN_2)<=30) // sensor 3, ao ver preto, desacelera lado ESQUERDO do robô
  25. {
  26. OnFwd(OUT_C, 10);
  27. OnFwd(OUT_A, 50);
  28.  
  29. }
  30.  
  31.  
  32.  
  33.  
  34. }
  35. }
Add Comment
Please, Sign In to add comment