NXT::Motor Namespace Reference

Contains all the functions that have to do with a motor. More...


Functions

int GetRotationCount (Comm::NXTComm *comm, int port)
 Returns the rotation of a motor.
void ResetRotationCount (Comm::NXTComm *comm, int port, bool relative)
 Resets the specified motor's rotation count.
void SetForward (Comm::NXTComm *comm, int port, int power)
 Sets a motor to turn forward at a specified power.
void SetReverse (Comm::NXTComm *comm, int port, int power)
 Sets a motor to turn backward at a specified power.
void Stop (Comm::NXTComm *comm, int port, bool brake)
 Tells a motor to stop turning.
void BrakeOn (Comm::NXTComm *comm, int port)
 Tells a motor to turn the brake on.
void BrakeOff (Comm::NXTComm *comm, int port)
 Tells a motor to turn the brake off.
void GoTo (Comm::NXTComm *comm, int port, int power, int tacho, bool brake)
 Tells a motor to go to a certian angle and then stop.


Detailed Description

Contains all the functions that have to do with a motor.

Function Documentation

void NXT::Motor::BrakeOff ( Comm::NXTComm *  comm,
int  port 
)

Tells a motor to turn the brake off.

Parameters:
port The port that you wish to turn the brake off. Can be the numbers 0-2 or OUT_A, OUT_B, or OUT_C.

void NXT::Motor::BrakeOn ( Comm::NXTComm *  comm,
int  port 
)

Tells a motor to turn the brake on.

Parameters:
port The port that you wish to turn the brake on. Can be the numbers 0-2 or OUT_A, OUT_B, or OUT_C.

int NXT::Motor::GetRotationCount ( Comm::NXTComm *  comm,
int  port 
)

Returns the rotation of a motor.

Parameters:
port The port that you wish to retrieve the rotation. Can be the numbers 0-2 or OUT_A, OUT_B, or OUT_C.
Returns:
The rotation of the motor in degrees.

void NXT::Motor::GoTo ( Comm::NXTComm *  comm,
int  port,
int  power,
int  tacho,
bool  brake 
)

Tells a motor to go to a certian angle and then stop.

Parameters:
port The port that you wish to set. Can be the numbers 0-2 or OUT_A, OUT_B, or OUT_C.
power The power level (0-100) that you want the motor to recieve.
tacho The rotation count (in degrees) that you want the motor to turn to.
brake Whether or not you want the motor to brake or float when it is done turning.

void NXT::Motor::ResetRotationCount ( Comm::NXTComm *  comm,
int  port,
bool  relative 
)

Resets the specified motor's rotation count.

Parameters:
port The port that you wish to reset the rotation. Can be the numbers 0-2 or OUT_A, OUT_B, or OUT_C.
relative If true it resets the rotation relative to the last movement. If false it resets the rotation to its absolute position.

void NXT::Motor::SetForward ( Comm::NXTComm *  comm,
int  port,
int  power 
)

Sets a motor to turn forward at a specified power.

Parameters:
port The port that you wish to set. Can be the numbers 0-2 or OUT_A, OUT_B, or OUT_C.
power The power level (0-100) that you want the motor to recieve.

void NXT::Motor::SetReverse ( Comm::NXTComm *  comm,
int  port,
int  power 
)

Sets a motor to turn backward at a specified power.

Parameters:
port The port that you wish to set. Can be the numbers 0-2 or OUT_A, OUT_B, or OUT_C.
power The power level (0-100) that you want the motor to recieve.

void NXT::Motor::Stop ( Comm::NXTComm *  comm,
int  port,
bool  brake 
)

Tells a motor to stop turning.

Parameters:
port The port that you wish to turn off. Can be the numbers 0-2 or OUT_A, OUT_B, or OUT_C.
brake Whether or not you want the motor to brake or float.

SourceForge.net Logo