package testProject;

import lejos.nxt.LCD;
import lejos.nxt.Motor;

public class motorDriveProgram {

	public static void main(Boolean move) {
		
		int dialPos = 0;
		int speed = 500;
		int absValDial = 0;
		
		while (true){
			dialPos = Motor.A.getTachoCount();
			absValDial = Math.abs(dialPos);
			LCD.clear();
			LCD.drawInt(dialPos, 0, 0);
			
			if (move && dialPos > 5){
				Motor.B.setSpeed(speed);
				Motor.C.setSpeed(speed+absValDial);
				driveFunctions.SimpleForward();
			} else if (move && dialPos < -5){
				Motor.B.setSpeed(speed+absValDial);
				Motor.C.setSpeed(speed);
				driveFunctions.SimpleForward();
			} else if (!move && dialPos > 5){
				Motor.B.setSpeed(absValDial);
				Motor.C.setSpeed(0);
				driveFunctions.SimpleForward();
			} else if (!move && dialPos < -5){
				Motor.B.setSpeed(0);
				Motor.C.setSpeed(absValDial);
				driveFunctions.SimpleForward();
			}
			
			
		}
		
	}

}
