ECRobot C++ API for LEGO MINDSTORMS NXT  1.0.10
ecrobot::Nxt Class Reference

NXT intelligent block class. More...

#include <Nxt.h>

List of all members.

Public Types

enum  eButton { RUN_ON = 0x01, ENTR_ON = 0x02, RUN_ENTR_ON = (RUN_ON | ENTR_ON), BUTTONS_OFF = 0x00 }
 NXT Button enum. More...
enum  eNxtButton { ORANGE_RECT = 0x01, LEFT = 0x02, RIGHT = 0x04, GRAY_RECT = 0x08 }
 NXT Button enum. More...

Public Member Functions

 Nxt (void)
 Constructor.
eButton getButtons (void) const
 Get NXT buttons status.
eNxtButton getNxtButtons (void) const
 Get NXT buttons status.
S16 getBattMv (void) const
 Get battery voltage in mV.
void shutdown (void)
 Shutdown (Power off) the NXT.
void restart (void)
 Restart the running application.
void execNXTBIOS (void)
 Execute NXT BIOS.

Detailed Description

NXT intelligent block class.


Member Enumeration Documentation

NXT Button enum.

Note that this enum is kept for backward compatibility. Recommend to use eNxtButton enum.

Enumerator:
RUN_ON 

RUN (right triangle) button is ON.

ENTR_ON 

ENTR(orange rectangle) button is ON.

RUN_ENTR_ON 

RUN and ENTR buttons are ON.

BUTTONS_OFF 

RUN and ENTR buttons are OFF.

NXT Button enum.

Note that left triangle and gray colored rectangle buttons on the NXT are reserved for stopping and shutdown application program. To use these buttons for an application, define NO_RUN_ENTER_STOP_EXIT compile switch macro while compiling the application.

Enumerator:
ORANGE_RECT 

Orange colored rectangle button.

LEFT 

Left triangle button.

RIGHT 

Right triangle button.

GRAY_RECT 

Gray colored rectangle button.


Constructor & Destructor Documentation

ecrobot::Nxt::Nxt ( void  )

Constructor.

Parameters:
-
Returns:
-

Member Function Documentation

void ecrobot::Nxt::execNXTBIOS ( void  )

Execute NXT BIOS.

Note that this API works only when NXT BIOS is used. Otherwise, it does nothing.
Note that NXT BIOS 1.0.4 or later is required.

Parameters:
-
Returns:
-
S16 ecrobot::Nxt::getBattMv ( void  ) const

Get battery voltage in mV.

Parameters:
-
Returns:
Battery voltage in mV

Get NXT buttons status.

Note that this API is kept for backward compatibility. Recommend to use getNxtButtons API instead of getButtons API.

Parameters:
-
Returns:
Status of RUN/ENTR buttons

Get NXT buttons status.

Parameters:
-
Returns:
Status of all buttons on the NXT (true:pressed/false:not pressed)
void ecrobot::Nxt::restart ( void  )

Restart the running application.

Parameters:
-
Returns:
-
void ecrobot::Nxt::shutdown ( void  )

Shutdown (Power off) the NXT.

Parameters:
-
Returns:
-

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Enumerator Friends Defines