|
NXT C++ Bluetooth Library | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Class for analog sensors - also works as the base class for all other sensors
Constructor Summary | |
Sensor( Sensor_port port, Connection* connection, Sensor_type sensor_type, Sensor_mode sensor_mode )
Sensor constructor |
|
virtual ~Sensor()
|
Method Summary | |
virtual unsigned char |
get_i2c_address()
Get the I2C address (Dummy method does nothing - is implemented in some sub class ) |
virtual Sensor_mode |
get_mode()
Get the sensor mode |
virtual Sensor_port |
get_port()
Get the sensor port |
virtual Sensor_type |
get_type()
Get the sensor type |
virtual void |
init( bool reply = false )
Initiate the sensor (sets its type and mode) |
virtual string |
print()
Get the sensor reading as a string (init method will be called if the sensor has not been initialized) |
virtual int |
read()
Get the sensor reading (mode dependent) (init method will be called if the sensor has not been initialized) |
virtual int |
read( Result& result )
Get multiple sensor readings (Dummy method does nothing - is implemented in some sub classes) |
virtual void |
set( unsigned int value )
Set a parameter on the sensor (Dummy method does nothing - is implemented in some sub classes) |
Constructor Detail |
public Sensor( Sensor_port port, Connection* connection, Sensor_type sensor_type, Sensor_mode sensor_mode );
port
- [which sensor port to use]
*connection
- [attach a connection]
sensor_type
- [set the sensor type]
sensor
- mode [set the sensor mode]public virtual ~Sensor();
Method Detail |
public virtual unsigned char get_i2c_address();
public virtual Sensor_mode get_mode();
public virtual Sensor_port get_port();
public virtual Sensor_type get_type();
public virtual void init( bool reply = false );
reply
- [true = require reply from NXT; false = no reply from NXT]public virtual string print();
public virtual int read();
public virtual int read( Result& result );
&result
- [reference where the sensor readings are placed]public virtual void set( unsigned int value );
|
NXT C++ Bluetooth Library | ||||||
FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |