You are on page 1of 1

task main () { int contacto,distancia,rotaciones; long angulo; SetSensorTouch(IN_1); SetSensorLowspeed(IN_4); OnFwd(OUT_BC,75); contacto=SENSOR_1; while(contacto==0){ contacto=SENSOR_1; } Off(OUT_BC); RotateMotor(OUT_A, 75,

-45); //pinzas //OnFwd(OUT_BC,75); ResetRotationCount(OUT_BC); angulo = MotorRotationCount(OUT_B); rotaciones=(23*360)/15; while (angulo <=rotaciones){ RotateMotor(OUT_B, 75,1); RotateMotor(OUT_C, 75,-1); angulo = MotorRotationCount(OUT_B);}

distancia=SensorUS(IN_4); OnFwd(OUT_BC,75); while( distancia > 15){ distancia=SensorUS(IN_4); } Off(OUT_BC); RotateMotor(OUT_A, 75, 45); }

You might also like