Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## lejos.nxt
Class MotorPort

    java.lang.Object
      lejos.nxt.MotorPort

    public class MotorPort

extends Object

Abstraction for a NXT output port.

Field Summary
`static MotorPort` | `A` MotorPort A.
`static MotorPort` | `B` MotorPort B.
`static MotorPort` | `C` MotorPort C.

Method Summary
`void` | `controlMotor(int power, int mode)` Low-level method to control a motor.
`int` | `getTachoCount()` returns tachometer count
`static int` | `getTachoCountById(int aMotor)`
`void` | `resetTachoCount()` resets the tachometer count to 0;
`static void` | `resetTachoCountById(int aMotor)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait`

Field Detail

### A

    public static final MotorPort A

  MotorPort A.

### B

    public static final MotorPort B

  MotorPort B.

### C

    public static final MotorPort C

  MotorPort C.

Method Detail

### controlMotor

    public void controlMotor(int power,
                             int mode)

  Low-level method to control a motor.

  Parameters:
    `power` - power from 0-100
    `mode` - 1=forward, 2=backward, 3=stop, 4=float

### getTachoCount

    public int getTachoCount()

  returns tachometer count

### getTachoCountById

    public static int getTachoCountById(int aMotor)

### resetTachoCount

    public void resetTachoCount()

  resets the tachometer count to 0;

### resetTachoCountById

    public static void resetTachoCountById(int aMotor)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD