All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lejos.robotics.ReversedEncoderMotor Maven / Gradle / Ivy

Go to download

leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2013 it was ported to the LEGO EV3 brick.

The newest version!
package lejos.robotics;

class ReversedEncoderMotor implements EncoderMotor {

	EncoderMotor encoderMotor;
	
	ReversedEncoderMotor(EncoderMotor motor) {
		this.encoderMotor = motor;
	}
	
	public int getPower() {
		return encoderMotor.getPower();
	}

	public void setPower(int power) {
		encoderMotor.setPower(power);
	}

	public void backward() {
		encoderMotor.forward();
	}

	public void flt() {
		encoderMotor.flt();
	}

	public void forward() {
		encoderMotor.backward();
	}

	public boolean isMoving() {
		return encoderMotor.isMoving();
	}

	public void stop() {
		encoderMotor.stop();
	}

	public int getTachoCount() {
		return -encoderMotor.getTachoCount();
	}

	public void resetTachoCount() {
		encoderMotor.resetTachoCount();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy