MonoBrick EV3 Firmware
|
Base class for all I2C sensors. This should be used when implementing a new I2C sensor More...
Public Member Functions | |
I2CSensor (SensorPort port, byte address, I2CMode mode) | |
abstract string | ReadAsString () |
Reads the sensor value as a string. More... | |
abstract void | SelectNextMode () |
Selects the next mode. More... | |
abstract string | GetSensorName () |
Gets the name of the sensor. More... | |
abstract void | SelectPreviousMode () |
Selects the previous mode. More... | |
abstract int | NumberOfModes () |
Numbers the of modes. More... | |
abstract string | SelectedMode () |
.m.-, More... | |
Public Attributes | |
const int | BufferSize = 30 |
Protected Member Functions | |
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 | |
byte | I2CAddress = 0x00 |
const int | NumberOfSensorPorts = SensorManager.NumberOfSensorPorts |
SensorPort | port |
I2CMode | mode |
Properties | |
UARTMode | uartMode [get, set] |
SensorPort | Port [get] |
Properties inherited from MonoBrickFirmware.Sensors.ISensor | |
SensorPort | Port [get] |
Sensor port More... | |
Base class for all I2C sensors. This should be used when implementing a new I2C sensor
|
pure virtual |
Gets the name of the sensor.
Implements MonoBrickFirmware.Sensors.ISensor.
Implemented in MonoBrickFirmware.Sensors.NXTUltraSonicSensor, MonoBrickFirmware.Sensors.HiTecTiltSensor, MonoBrickFirmware.Sensors.HiTecColorSensor, and MonoBrickFirmware.Sensors.HiTecCompassSensor.
|
pure virtual |
Numbers the of modes.
Implements MonoBrickFirmware.Sensors.ISensor.
Implemented in MonoBrickFirmware.Sensors.NXTUltraSonicSensor, MonoBrickFirmware.Sensors.HiTecTiltSensor, MonoBrickFirmware.Sensors.HiTecColorSensor, and MonoBrickFirmware.Sensors.HiTecCompassSensor.
|
pure virtual |
Reads the sensor value as a string.
Implements MonoBrickFirmware.Sensors.ISensor.
Implemented in MonoBrickFirmware.Sensors.NXTUltraSonicSensor, MonoBrickFirmware.Sensors.HiTecTiltSensor, MonoBrickFirmware.Sensors.HiTecColorSensor, and MonoBrickFirmware.Sensors.HiTecCompassSensor.
|
inlineprotected |
Reads a 8 byte register from the sensor
register | Register to read |
|
inlineprotected |
Reads a register from the sensor
register | Register to read |
rxLength | The number of bytes to read |
|
pure virtual |
.m.-,
Implements MonoBrickFirmware.Sensors.ISensor.
Implemented in MonoBrickFirmware.Sensors.NXTUltraSonicSensor, MonoBrickFirmware.Sensors.HiTecTiltSensor, MonoBrickFirmware.Sensors.HiTecColorSensor, and MonoBrickFirmware.Sensors.HiTecCompassSensor.
|
pure virtual |
Selects the next mode.
Implements MonoBrickFirmware.Sensors.ISensor.
Implemented in MonoBrickFirmware.Sensors.NXTUltraSonicSensor, MonoBrickFirmware.Sensors.HiTecTiltSensor, MonoBrickFirmware.Sensors.HiTecColorSensor, and MonoBrickFirmware.Sensors.HiTecCompassSensor.
|
pure virtual |
Selects the previous mode.
Implements MonoBrickFirmware.Sensors.ISensor.
Implemented in MonoBrickFirmware.Sensors.NXTUltraSonicSensor, MonoBrickFirmware.Sensors.HiTecTiltSensor, MonoBrickFirmware.Sensors.HiTecColorSensor, and MonoBrickFirmware.Sensors.HiTecCompassSensor.
|
inlineprotected |
Write and read an array of bytes to the sensor
register | Register to write to. |
data | Byte array to write |
rxLength | Length of the expected reply |
|
inlineprotected |
Writes a byte to a register.
register | Register to write to |
data | Data byte to write |