MonoBrick EV3 Firmware
Public Member Functions | Properties | List of all members
MonoBrickFirmware.Sensors.NXTUltraSonicSensor Class Reference

Sonar sensor More...

Inheritance diagram for MonoBrickFirmware.Sensors.NXTUltraSonicSensor:
MonoBrickFirmware.Sensors.I2CSensor MonoBrickFirmware.Sensors.ISensor

Public Member Functions

 NXTUltraSonicSensor (SensorPort port)
 Initializes a new instance of the MonoBrick.NXT.Sonar class in centimeter mode More...
 
 NXTUltraSonicSensor (SensorPort port, UltraSonicMode mode)
 Initializes a new instance of the MonoBrick.NXT.Sonar class. More...
 
float ReadDistance ()
 Read the distance in either centiinches or centimeter More...
 
void SingleShot ()
 Fire a single shot More...
 
void Off ()
 Turn off the sonar to save power More...
 
void Continuous ()
 Do Continuous measurements More...
 
new void Reset ()
 Reset the sensor More...
 
override string ReadAsString ()
 Reads the sensor value as a string. More...
 
override string GetSensorName ()
 Gets the name of the sensor. More...
 
override void SelectNextMode ()
 Selects the next mode. More...
 
override void SelectPreviousMode ()
 Selects the previous mode. More...
 
override int NumberOfModes ()
 Numbers the of modes. More...
 
override string SelectedMode ()
 .m.-, More...
 
- Public Member Functions inherited from MonoBrickFirmware.Sensors.I2CSensor
 I2CSensor (SensorPort port, byte address, I2CMode mode)
 

Properties

UltraSonicMode Mode [get, set]
 Gets or sets the sonar mode. More...
 
- Properties inherited from MonoBrickFirmware.Sensors.I2CSensor
UARTMode uartMode [get, set]
 
SensorPort Port [get]
 
- Properties inherited from MonoBrickFirmware.Sensors.ISensor
SensorPort Port [get]
 Sensor port More...
 

Additional Inherited Members

- Public Attributes inherited from MonoBrickFirmware.Sensors.I2CSensor
const int BufferSize = 30
 
- Protected Member Functions inherited from MonoBrickFirmware.Sensors.I2CSensor
void Reset ()
 
void SetMode ()
 
bool Initialise ()
 
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)
 
byte[] WriteAndRead (byte register, byte[] data, int rxLength)
 Write and read an array of bytes to the sensor More...
 
- Protected Attributes inherited from MonoBrickFirmware.Sensors.I2CSensor
byte I2CAddress = 0x00
 
const int NumberOfSensorPorts = SensorManager.NumberOfSensorPorts
 
SensorPort port
 
I2CMode mode
 

Detailed Description

Sonar sensor

Constructor & Destructor Documentation

MonoBrickFirmware.Sensors.NXTUltraSonicSensor.NXTUltraSonicSensor ( SensorPort  port)
inline

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

MonoBrickFirmware.Sensors.NXTUltraSonicSensor.NXTUltraSonicSensor ( SensorPort  port,
UltraSonicMode  mode 
)
inline

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

Parameters
modeThe sonar mode

Member Function Documentation

void MonoBrickFirmware.Sensors.NXTUltraSonicSensor.Continuous ( )
inline

Do Continuous measurements

override string MonoBrickFirmware.Sensors.NXTUltraSonicSensor.GetSensorName ( )
inlinevirtual

Gets the name of the sensor.

Returns
The sensor name.

Implements MonoBrickFirmware.Sensors.I2CSensor.

override int MonoBrickFirmware.Sensors.NXTUltraSonicSensor.NumberOfModes ( )
inlinevirtual

Numbers the of modes.

Returns
The number of modes

Implements MonoBrickFirmware.Sensors.I2CSensor.

void MonoBrickFirmware.Sensors.NXTUltraSonicSensor.Off ( )
inline

Turn off the sonar to save power

override string MonoBrickFirmware.Sensors.NXTUltraSonicSensor.ReadAsString ( )
inlinevirtual

Reads the sensor value as a string.

Returns
The value as a string

Implements MonoBrickFirmware.Sensors.I2CSensor.

float MonoBrickFirmware.Sensors.NXTUltraSonicSensor.ReadDistance ( )
inline

Read the distance in either centiinches or centimeter

new void MonoBrickFirmware.Sensors.NXTUltraSonicSensor.Reset ( )
inline

Reset the sensor

override string MonoBrickFirmware.Sensors.NXTUltraSonicSensor.SelectedMode ( )
inlinevirtual

.m.-,

Returns
The mode.

Implements MonoBrickFirmware.Sensors.I2CSensor.

override void MonoBrickFirmware.Sensors.NXTUltraSonicSensor.SelectNextMode ( )
inlinevirtual

Selects the next mode.

Implements MonoBrickFirmware.Sensors.I2CSensor.

override void MonoBrickFirmware.Sensors.NXTUltraSonicSensor.SelectPreviousMode ( )
inlinevirtual

Selects the previous mode.

Implements MonoBrickFirmware.Sensors.I2CSensor.

void MonoBrickFirmware.Sensors.NXTUltraSonicSensor.SingleShot ( )
inline

Fire a single shot

Property Documentation

UltraSonicMode MonoBrickFirmware.Sensors.NXTUltraSonicSensor.Mode
getset

Gets or sets the sonar mode.

The sonar mode


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