package edu.kit.mindstormer.program.implementation;

import edu.kit.mindstormer.movement.Movement;
import edu.kit.mindstormer.movement.State;
import edu.kit.mindstormer.program.AbstractProgram;
import edu.kit.mindstormer.sensor.Sensor;
import lejos.hardware.Sound;

public class ChainBridge extends AbstractProgram {
	float[] followLineSearchAngles = {45, 145, 200, 100};

	@Override
	public void run() {
		Movement.move(true, 20);
		while(!Sensor.sampleTouchBoth());
		
		Movement.moveDistance(-22, 10);
		State.waitForMovementMotors();	
		Movement.rotate(-90, 10);
		State.waitForMovementMotors();
		
		Movement.moveDistance(-50, 10);
		State.waitForMovementMotors();
		
		Sound.beep();
		Movement.stop();
		while(Sensor.sampleDistance() < 40) {
			Movement.holdDistance2(false, 10, 10);
		}
		Sound.beep();
		
		Movement.move(true, 10);
		while(Sensor.sampleDistance() > 20);
		Movement.alignParallel(40, 10);
		Movement.moveDistance(-40, 10);
		State.waitForMovementMotors();
		Movement.moveDistance(-150, 35);
		State.waitForMovementMotors();
		
		Movement.move(false, 10);
		while(Sensor.sampleDistance() > 20);
		while(Sensor.sampleDistance() < 20) {
			Movement.holdDistance2(false, 10, 10);
		}
	}

}

@@ -459,24 +459,26 @@
 hBoth());%0A%09%09
+/*
 %0A%09%09Movement.
@@ -587,32 +587,111 @@
 vementMotors();%0A
+%09%09*/%0A%09%09Movement.moveCircle(-90, true, 9, 10);%0A%09%09State.waitForMovementMotors();%0A
 %09%09%0A%09%09Movement.mo
@@ -1080,17 +1080,17 @@
 tance(-1
-5
+7
 0, 35);%0A

change change bridge to use circle instead of rotate