pt.citar.diablu.nxt.brick
Class NXTMotor

java.lang.Object
  extended by pt.citar.diablu.nxt.brick.NXTComponent
      extended by pt.citar.diablu.nxt.brick.NXTMotor

public class NXTMotor
extends NXTComponent

Author:
Jorge Cardoso

Constructor Summary
NXTMotor(NXTBrick brick, byte portAttached)
          Creates a new instance of NXTMotor
 
Method Summary
 boolean fastStop()
           
 boolean forward(byte power)
          Make the motor go forward, ramping up the speed.
 boolean forwardLimit(byte power, int tachoLimit)
           
 long getBlockTachoCount()
           
 long getRotationCount()
           
 long getTachoCount()
           
 long getTachoLimit()
           
 boolean handBrake()
           
 void resetMotorPosition(boolean relative)
           
 boolean slowStop()
          Stops the motor slowly.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NXTMotor

public NXTMotor(NXTBrick brick,
                byte portAttached)
Creates a new instance of NXTMotor

Method Detail

forward

public boolean forward(byte power)
Make the motor go forward, ramping up the speed.

Parameters:
power - The power of the motor.
Returns:
True, if no error; False otherwise.

forwardLimit

public boolean forwardLimit(byte power,
                            int tachoLimit)

slowStop

public boolean slowStop()
Stops the motor slowly.

Returns:
True, if no error; False otherwise.

handBrake

public boolean handBrake()

fastStop

public boolean fastStop()

getTachoLimit

public long getTachoLimit()

getTachoCount

public long getTachoCount()

getBlockTachoCount

public long getBlockTachoCount()

getRotationCount

public long getRotationCount()

resetMotorPosition

public void resetMotorPosition(boolean relative)


Processing library NXTComm by Jorge C. S. Cardoso. (c) 2014