MonoBrick Mindstorms Communication Library
Public Member Functions | Properties | List of all members
MonoBrick.NXT.Sonar Class Reference

Sonar sensor More...

Inheritance diagram for MonoBrick.NXT.Sonar:
MonoBrick.NXT.I2CBase MonoBrick.NXT.Sensor MonoBrick.ISensor

Public Member Functions

 Sonar ()
 Initializes a new instance of the MonoBrick.NXT.Sonar class in centimeter mode More...
 
 Sonar (SonarMode mode)
 Initializes a new instance of the MonoBrick.NXT.Sonar class. More...
 
override void Initialize ()
 Initialize the sensor More...
 
int ReadDistance ()
 Read the distance in either centiinches or centimeter More...
 
void SingleShot (bool reply)
 Fire a single shot More...
 
void Off (bool reply)
 Turn off the sonar to save power More...
 
void Continuous (bool reply)
 Do Continuous measurements More...
 
override void Reset (bool reply)
 Reset the sensor More...
 
override string ReadAsString ()
 Reads the sensor value as a string. More...
 
- Public Member Functions inherited from MonoBrick.NXT.I2CBase
 I2CBase (I2CMode mode, byte sensorAddress)
 Initializes a new instance of the MonoBrick.NXT.I2CSensor class. More...
 
 I2CBase (I2CMode mode, byte sensorAddress, int pollInterval)
 Initializes a new instance of the MonoBrick.NXT.I2CSensor class. More...
 
- Public Member Functions inherited from MonoBrick.NXT.Sensor
 Sensor ()
 Initializes a new instance of the MonoBrick.NXT.Sensor class with no sensor as type. More...
 
 Sensor (SensorType sensorType, SensorMode sensorMode)
 Initializes a new instance of the MonoBrick.NXT.Sensor class. More...
 

Properties

new SonarMode Mode [get, set]
 Gets or sets the sonar mode. More...
 
- Properties inherited from MonoBrick.NXT.I2CBase
byte I2CAddress [get]
 Gets the i2C address More...
 
- Properties inherited from MonoBrick.NXT.Sensor
SensorMode Mode [get, set]
 The sensor mode to use More...
 
SensorType Type [get, set]
 The sensor type to use More...
 
bool IsInitialized [get]
 Gets a value indicating whether the sensor has been initialized. More...
 
static Dictionary< string, SensorSensorDictionary [get]
 Gets a dictionary of sensors that has been implemented. Can be use in a combobox or simular More...
 

Additional Inherited Members

- Protected Member Functions inherited from MonoBrick.NXT.I2CBase
byte[] ReadRegister (byte register)
 Reads a 8 byte register from the sensor More...
 
byte[] ReadRegister (byte register, byte rxLength)
 Reads a register from the sensor More...
 
void WriteRegister (byte register, byte data)
 Writes a byte to a register. More...
 
void WriteRegister (byte register, byte data, bool reply)
 Writes a byte to a register. More...
 
void I2CWrite (byte[] txData, byte rxLength)
 Write byte array to sensor More...
 
void I2CWrite (byte[] txData, byte rxLength, bool reply)
 Write byte array to sensor More...
 
byte[] I2CWriteAndRead (byte[] data, byte rxLength)
 Write and read an array of bytes to sensor More...
 
- Protected Attributes inherited from MonoBrick.NXT.Sensor
SensorPort port
 The sensor port to use More...
 
Connection< Command, Replyconnection = null
 The connection to use for communication More...
 
bool hasInit
 True if sensor has been initialized More...
 

Detailed Description

Sonar sensor

Constructor & Destructor Documentation

MonoBrick.NXT.Sonar.Sonar ( )
inline

Initializes a new instance of the MonoBrick.NXT.Sonar class in centimeter mode

MonoBrick.NXT.Sonar.Sonar ( SonarMode  mode)
inline

Initializes a new instance of the MonoBrick.NXT.Sonar class.

Parameters
modeThe sonar mode

Member Function Documentation

void MonoBrick.NXT.Sonar.Continuous ( bool  reply)
inline

Do Continuous measurements

Parameters
replyIf set to true brick will send a reply
override void MonoBrick.NXT.Sonar.Initialize ( )
inlinevirtual

Initialize the sensor

Reimplemented from MonoBrick.NXT.I2CBase.

void MonoBrick.NXT.Sonar.Off ( bool  reply)
inline

Turn off the sonar to save power

Parameters
replyIf set to true brick will send a reply
override string MonoBrick.NXT.Sonar.ReadAsString ( )
inlinevirtual

Reads the sensor value as a string.

Returns
The value as a string

Implements MonoBrick.NXT.I2CBase.

int MonoBrick.NXT.Sonar.ReadDistance ( )
inline

Read the distance in either centiinches or centimeter

override void MonoBrick.NXT.Sonar.Reset ( bool  reply)
inlinevirtual

Reset the sensor

Parameters
replyIf set to true brick will send a reply

Reimplemented from MonoBrick.NXT.I2CBase.

void MonoBrick.NXT.Sonar.SingleShot ( bool  reply)
inline

Fire a single shot

Parameters
replyIf set to true the brick will send a reply

Property Documentation

new SonarMode MonoBrick.NXT.Sonar.Mode
getset

Gets or sets the sonar mode.

The sonar mode


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