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

lejos.remote.ev3.RMIRemoteBattery 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.remote.ev3;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import lejos.hardware.ev3.LocalEV3;
import lejos.remote.ev3.RMIBattery;

public class RMIRemoteBattery extends UnicastRemoteObject implements RMIBattery {

	protected RMIRemoteBattery() throws RemoteException {
		super(0);
	}

	@Override
	public int getVoltageMilliVolt() throws RemoteException {
		return LocalEV3.get().getPower().getVoltageMilliVolt();
	}

	@Override
	public float getVoltage() throws RemoteException {
		return LocalEV3.get().getPower().getVoltage();
	}

	@Override
	public float getBatteryCurrent() throws RemoteException {
		return LocalEV3.get().getPower().getBatteryCurrent();
	}

	@Override
	public float getMotorCurrent() throws RemoteException {
		return LocalEV3.get().getPower().getMotorCurrent();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy