RobotLib  1
A set of software wrappers for Rovio, Roomba and NXT robots written in C#.
 All Classes Namespaces Functions Variables Enumerations Properties Pages
Public Member Functions | Public Attributes | List of all members
NXT.API.DirectCommand Class Reference

Direct commands. More...

Inheritance diagram for NXT.API.DirectCommand:
NXT.Component

Public Member Functions

 DirectCommand (Robot _robot)
 The constructor.
 
void StartProgram (string name)
 Start the program stored in the NXT.
 
void StopProgram ()
 Stop executing the current program.
 
void PlaySoundFile (string name, bool loop)
 Play a specified sound file. The correct extension is .rso.
 
void PlayTone (int frequency, int duration)
 Play tone with the specified frequency and duration.
 
void SetOutputState (int port, int power_setpoint, OutputMode mode, RegulationMode regulation_mode, int turn_ratio, RunState run_state, int tacho_limit)
 Set output state for a specfic port.
 
void SetInputMode (int port, int sensor_type, int sensor_mode)
 Set input mode for the specified port.
 
void GetOutputState (int port, out byte[] response)
 Get readings from the specified output port.
 
void GetInputValues (int port, out byte[] response)
 Get readings from the input port.
 
void ResetInputScaledValue (int port)
 Reset the scaled value for the specified input port.
 
void MessageWrite (string data, int box)
 Write a text message to the specified mailbox.
 
void ResetMotorPosition (int port, bool relative)
 Reset motor position.
 
int GetBatteryLevel ()
 Get battery level in mV.
 
void StopSoundPlayback ()
 Stop playing the current sound.
 
int KeepAlive ()
 Keep alive, return the current time limit in ms.
 
int LSGetStatus (int port)
 Return the available bytes to read
 
void LSWrite (int port, byte[] tx_data, int rx_data_length)
 LS Write command. tx_data should not be longer than 16 bytes.
 
void LSRead (int port, out byte[] response)
 LS Read command
 
string GetCurrentProgramName ()
 Get name of the current program.
 
string MessageRead (int remote_inbox, int local_inbox, bool remove)
 Read message from the specified inbox.
 
- Public Member Functions inherited from NXT.Component
 Component (Robot _robot)
 The constructor.
 

Public Attributes

bool RequestResponse = false
 CheckResponse will require a confirmation from NXT. It might be slower and return exceptions.
 
- Public Attributes inherited from NXT.Component
bool AutoUpdate = true
 Automatic update option for methods requesting more than one piece of information.
 

Additional Inherited Members

- Protected Attributes inherited from NXT.Component
Robot robot
 The robot class, accessible by all dervied classes.
 

Detailed Description

Direct commands.

Constructor & Destructor Documentation

NXT.API.DirectCommand.DirectCommand ( Robot  _robot)

The constructor.

Member Function Documentation

int NXT.API.DirectCommand.GetBatteryLevel ( )

Get battery level in mV.

string NXT.API.DirectCommand.GetCurrentProgramName ( )

Get name of the current program.

void NXT.API.DirectCommand.GetInputValues ( int  port,
out byte[]  response 
)

Get readings from the input port.

void NXT.API.DirectCommand.GetOutputState ( int  port,
out byte[]  response 
)

Get readings from the specified output port.

int NXT.API.DirectCommand.KeepAlive ( )

Keep alive, return the current time limit in ms.

int NXT.API.DirectCommand.LSGetStatus ( int  port)

Return the available bytes to read

void NXT.API.DirectCommand.LSRead ( int  port,
out byte[]  response 
)

LS Read command

void NXT.API.DirectCommand.LSWrite ( int  port,
byte[]  tx_data,
int  rx_data_length 
)

LS Write command. tx_data should not be longer than 16 bytes.

string NXT.API.DirectCommand.MessageRead ( int  remote_inbox,
int  local_inbox,
bool  remove 
)

Read message from the specified inbox.

void NXT.API.DirectCommand.MessageWrite ( string  data,
int  box 
)

Write a text message to the specified mailbox.

void NXT.API.DirectCommand.PlaySoundFile ( string  name,
bool  loop 
)

Play a specified sound file. The correct extension is .rso.

void NXT.API.DirectCommand.PlayTone ( int  frequency,
int  duration 
)

Play tone with the specified frequency and duration.

Parameters
frequency200-14000 Hz
durationin ms
void NXT.API.DirectCommand.ResetInputScaledValue ( int  port)

Reset the scaled value for the specified input port.

void NXT.API.DirectCommand.ResetMotorPosition ( int  port,
bool  relative 
)

Reset motor position.

void NXT.API.DirectCommand.SetInputMode ( int  port,
int  sensor_type,
int  sensor_mode 
)

Set input mode for the specified port.

void NXT.API.DirectCommand.SetOutputState ( int  port,
int  power_setpoint,
OutputMode  mode,
RegulationMode  regulation_mode,
int  turn_ratio,
RunState  run_state,
int  tacho_limit 
)

Set output state for a specfic port.

void NXT.API.DirectCommand.StartProgram ( string  name)

Start the program stored in the NXT.

Recognised extensions: .rxe - user defined programs .rtm - try me programs .rfw - firmware .rxe - user defined programs .rpg - on-brick programs .rtm - try-me programs

void NXT.API.DirectCommand.StopProgram ( )

Stop executing the current program.

void NXT.API.DirectCommand.StopSoundPlayback ( )

Stop playing the current sound.

Member Data Documentation

bool NXT.API.DirectCommand.RequestResponse = false

CheckResponse will require a confirmation from NXT. It might be slower and return exceptions.


The documentation for this class was generated from the following file: