Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task main()
- {
- SetSensor(S1, SENSOR_COLORBLUE);
- SetSensor(S2, SENSOR_COLORBLUE);
- //white==48; apenas para decorar
- // black==18;
- //green==18;
- while(true)
- {
- if(Sensor(IN_1)>30 && Sensor(IN_2)>30) // ao ver branco, andar pra frente
- OnFwd(OUT_AC, 65);
- }
- if(Sensor(IN_1)<30) // sensor 2, ao ver preto, desacelera lado DIREITO do robô
- {
- OnFwd(OUT_A, 10);
- OnFwd(OUT_C, 50);
- }
- if(Sensor(IN_2)<=30) // sensor 3, ao ver preto, desacelera lado ESQUERDO do robô
- {
- OnFwd(OUT_C, 10);
- OnFwd(OUT_A, 50);
- }
- }
- }
Add Comment
Please, Sign In to add comment