|
NXT C++ Bluetooth Library | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Class for the NXT motors
Constructor Summary | |
Motor( Motor_port port, Connection* connection )
|
Method Summary | |
Motor_port |
get_port()
Get the motor port |
long int |
get_rotation()
Get the position of the motor |
bool |
is_running()
Is the motor running |
void |
move_to( char speed, long int target, int tolerance )
Move to a target degree - function will return when the motor is done moving (this is experimental) |
void |
off( bool reply = false )
Make the motor coast |
void |
on( char speed, unsigned int degrees = 0, bool reply = false )
Make the motor turn |
void |
reset_rotation( bool reply = false )
Reset the position of the motor |
void |
stop( bool reply = false )
Brings the motor to a full stop |
Constructor Detail |
public Motor( Motor_port port, Connection* connection );
port
- [which motor port to use]
*connection
- [attach a connection]Method Detail |
public Motor_port get_port();
public long int get_rotation();
public bool is_running();
public void move_to( char speed, long int target, int tolerance );
speed
- [set the speed of the motor (the sign has no influence)]
target
- [set the target degree]
tolerance
- [allow some torance to avoid hanging the function (don't set this below 4)]public void off( bool reply = false );
reply
- [true = require reply from NXT; false = no reply from NXT]public void on( char speed, unsigned int degrees = 0, bool reply = false );
speed
- [set the speed of the motor (the sign will determine the direction of the motor)]
degree
- [makes the motor turn x degrees (if set to zero the motor will turn forever)]
reply
- [true = require reply from NXT; false = no reply from NXT]public void reset_rotation( bool reply = false );
reply
- [true = require reply from NXT; false = no reply from NXT]public void stop( bool reply = false );
reply
- [true = require reply from NXT; false = no reply from NXT]
|
NXT C++ Bluetooth Library | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |