Package lejos.remote.ev3
Class RemoteMotorPort
- java.lang.Object
-
- lejos.remote.ev3.RemoteIOPort
-
- lejos.remote.ev3.RemoteMotorPort
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,BasicMotorPort,BasicSensorPort,IOPort,TachoMotorPort,EV3SensorConstants,SensorConstants,Encoder
public class RemoteMotorPort extends RemoteIOPort implements TachoMotorPort
-
-
Field Summary
Fields Modifier and Type Field Description protected RMIMotorPortrmiprotected RMIEV3rmiEV3-
Fields inherited from class lejos.remote.ev3.RemoteIOPort
currentMode, openPorts, port, ref, typ
-
Fields inherited from interface lejos.hardware.port.BasicMotorPort
BACKWARD, FLOAT, FORWARD, MAX_POWER, PWM_BRAKE, PWM_FLOAT, STOP
-
Fields inherited from interface lejos.hardware.sensor.EV3SensorConstants
ADC_REF, ADC_RES, CMD_AUTOMATIC, CMD_COL_AMB, CMD_COL_BLU, CMD_COL_COL, CMD_COL_GRN, CMD_COL_RED, CMD_CONNECTED, CMD_DISCONNECTED, CMD_FLOAT, CMD_NONE, CMD_PIN1, CMD_PIN5, CMD_SET, CONN_DAISYCHAIN, CONN_ERROR, CONN_INPUT_DUMB, CONN_INPUT_UART, CONN_NONE, CONN_NXT_COLOR, CONN_NXT_DUMB, CONN_NXT_IIC, CONN_OUTPUT_DUMB, CONN_OUTPUT_INTELLIGENT, CONN_OUTPUT_TACHO, CONN_UNKNOWN, IIC_DATA_LENGTH, MAX_DEVICE_DATALENGTH, MOTORS, PORTS, STATUS_BUSY, STATUS_FAIL, STATUS_OK, STATUS_STOP, TYPE_ERROR, TYPE_IIC_UNKNOWN, TYPE_MINITACHO, TYPE_NEWTACHO, TYPE_NONE, TYPE_NXT_COLOR, TYPE_NXT_IIC, TYPE_NXT_LIGHT, TYPE_NXT_SOUND, TYPE_NXT_TEST, TYPE_NXT_TOUCH, TYPE_TACHO, TYPE_TERMINAL, TYPE_THIRD_PARTY_END, TYPE_THIRD_PARTY_START, TYPE_UNKNOWN, UART_MAX_MODES
-
Fields inherited from interface lejos.hardware.sensor.SensorConstants
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE, WHITE, YELLOW
-
-
Constructor Summary
Constructors Constructor Description RemoteMotorPort(RMIEV3 rmiEV3)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the port, the port can not be used after this call.voidcontrolMotor(int power, int mode)Low-level method to control a motor.MotorRegulatorgetRegulator()Return the motor regulator associated with this motor port.intgetTachoCount()returns tachometer countbooleanopen(int typ, int portNum, RemotePort remotePort)voidresetTachoCount()resets the tachometer count to 0;voidsetPWMMode(int mode)-
Methods inherited from class lejos.remote.ev3.RemoteIOPort
getMode, getName, getType, setMode, setPinMode, setType, setTypeAndMode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lejos.hardware.port.IOPort
getName, setPinMode
-
-
-
-
Field Detail
-
rmi
protected RMIMotorPort rmi
-
rmiEV3
protected RMIEV3 rmiEV3
-
-
Constructor Detail
-
RemoteMotorPort
public RemoteMotorPort(RMIEV3 rmiEV3)
-
-
Method Detail
-
open
public boolean open(int typ, int portNum, RemotePort remotePort)- Overrides:
openin classRemoteIOPort
-
controlMotor
public void controlMotor(int power, int mode)Low-level method to control a motor.- Specified by:
controlMotorin interfaceBasicMotorPort- Parameters:
power- power from 0-100mode- defined inBasicMotorPort. 1=forward, 2=backward, 3=stop, 4=float.- See Also:
BasicMotorPort.FORWARD,BasicMotorPort.BACKWARD,BasicMotorPort.FLOAT,BasicMotorPort.STOP
-
getTachoCount
public int getTachoCount()
returns tachometer count- Specified by:
getTachoCountin interfaceEncoder- Returns:
- tachometer count in degrees
-
resetTachoCount
public void resetTachoCount()
resets the tachometer count to 0;- Specified by:
resetTachoCountin interfaceEncoder
-
setPWMMode
public void setPWMMode(int mode)
- Specified by:
setPWMModein interfaceBasicMotorPort
-
close
public void close()
Description copied from interface:IOPortClose the port, the port can not be used after this call.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceIOPort- Overrides:
closein classRemoteIOPort
-
getRegulator
public MotorRegulator getRegulator()
Description copied from interface:TachoMotorPortReturn the motor regulator associated with this motor port.- Specified by:
getRegulatorin interfaceTachoMotorPort- Returns:
- the motor regulator for this port.
-
-