lejos.nxt.remote
Class RemoteMotorPort

java.lang.Object
  extended by lejos.nxt.remote.RemoteMotorPort
All Implemented Interfaces:
BasicMotorPort, NXTProtocol, TachoMotorPort, Encoder

public class RemoteMotorPort
extends Object
implements NXTProtocol, TachoMotorPort

Supports a motor connected to a remote NXT

Author:
Lawrie Griffiths

Field Summary
 
Fields inherited from interface lejos.nxt.remote.NXTProtocol
ANGLE, ANGLESTEPSMODE, BOOLEANMODE, BOOT, BRAKE, CELSIUSMODE, CLOSE, CUSTOM, DELETE, DELETE_USER_FLASH, DIRECT_COMMAND_NOREPLY, DIRECT_COMMAND_REPLY, FAHRENHEITMODE, FIND_FIRST, FIND_NEXT, GET_BATTERY_LEVEL, GET_CURRENT_PROGRAM_NAME, GET_DEVICE_INFO, GET_FIRMWARE_VERSION, GET_INPUT_VALUES, GET_OUTPUT_STATE, HIGH_SPEED_BUFFER, KEEP_ALIVE, LIGHT_ACTIVE, LIGHT_INACTIVE, LOWSPEED, LOWSPEED_9V, LS_GET_STATUS, LS_READ, LS_WRITE, MESSAGE_READ, MESSAGE_WRITE, MODEMASK, MOTOR_RUN_STATE_IDLE, MOTOR_RUN_STATE_RAMPDOWN, MOTOR_RUN_STATE_RAMPUP, MOTOR_RUN_STATE_RUNNING, MOTORON, NO_OF_SENSOR_TYPES, NO_SENSOR, NXJ_DEFRAG, NXJ_DISCONNECT, NXJ_FIND_FIRST, NXJ_FIND_NEXT, NXJ_PACKET_MODE, OPEN_APPEND_DATA, OPEN_READ, OPEN_READ_LINEAR, OPEN_WRITE, OPEN_WRITE_DATA, OPEN_WRITE_LINEAR, PCTFULLSCALEMODE, PERIODCOUNTERMODE, PLAY_SOUND_FILE, PLAY_TONE, POLL, POLL_BUFFER, POLL_LENGTH, RAWMODE, READ, REFLECTION, REGULATED, REGULATION_MODE_IDLE, REGULATION_MODE_MOTOR_SPEED, REGULATION_MODE_MOTOR_SYNC, REPLY_COMMAND, RESET_MOTOR_POSITION, RESET_SCALED_INPUT_VALUE, SET_BRICK_NAME, SET_INPUT_MODE, SET_OUTPUT_STATE, SLOPEMASK, SOUND_DB, SOUND_DBA, START_PROGRAM, STOP_PROGRAM, STOP_SOUND_PLAYBACK, SWITCH, SYSTEM_COMMAND_NOREPLY, SYSTEM_COMMAND_REPLY, TEMPERATURE, TRANSITIONCNTMODE, WRITE
 
Fields inherited from interface lejos.nxt.BasicMotorPort
PWM_BRAKE, PWM_FLOAT
 
Constructor Summary
RemoteMotorPort(NXTCommand nxtCommand, int id)
           
 
Method Summary
 void controlMotor(int power, int mode)
           
 int getTachoCount()
          Returns the tachometer count.
 void resetTachoCount()
          Reset the tachometer count.
 void setPWMMode(int mode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteMotorPort

public RemoteMotorPort(NXTCommand nxtCommand,
                       int id)
Method Detail

controlMotor

public void controlMotor(int power,
                         int mode)
Specified by:
controlMotor in interface BasicMotorPort

getTachoCount

public int getTachoCount()
Description copied from interface: Encoder
Returns the tachometer count.

Specified by:
getTachoCount in interface Encoder
Returns:
tachometer count in degrees

resetTachoCount

public void resetTachoCount()
Description copied from interface: Encoder
Reset the tachometer count.

Specified by:
resetTachoCount in interface Encoder

setPWMMode

public void setPWMMode(int mode)
Specified by:
setPWMMode in interface BasicMotorPort