Package lejos.hardware.sensor
Interface SensorModes
-
- All Superinterfaces:
SampleProvider,SensorMode
- All Known Implementing Classes:
AnalogSensor,BaseSensor,CodeTemplate,CruizcoreGyro,DexterCompassSensor,DexterGPSSensor,DexterIMUSensor,DexterIMUSensor.DexterIMUAccelerationSensor,DexterLaserSensor,DexterPressureSensor250,DexterPressureSensor500,DexterThermalIRSensor,EV3ColorSensor,EV3GyroSensor,EV3IRSensor,EV3TouchSensor,EV3UltrasonicSensor,HiTechnicAccelerometer,HiTechnicAngleSensor,HiTechnicBarometer,HiTechnicColorSensor,HiTechnicCompass,HiTechnicEOPD,HiTechnicGyro,HiTechnicIRSeeker,HiTechnicIRSeekerV2,HiTechnicMagneticSensor,I2CSensor,IRLink,LDCMotor,LMotor,LSC,LServo,MindsensorsAbsoluteIMU,MindsensorsAccelerometer,MindsensorsCompass,MindsensorsDistanceSensorV2,MindsensorsLightSensorArray,MindsensorsLineLeader,MindSensorsNumPad,MindSensorsPressureSensor,MSC,MServo,NXTCam,NXTColorSensor,NXTe,NXTLightSensor,NXTMMX,NXTSoundSensor,NXTTouchSensor,NXTUltrasonicSensor,PFLink,PFMate,PSPNXController,RCXLightSensor,RCXLink,RCXMotorMultiplexer,RCXRotationSensor,RCXSensorMultiplexer,RCXThermometer,RFIDSensor,SensorMux,SumoEyesSensor,TetrixMotorController,TetrixServoController,TouchMUX,UARTSensor
public interface SensorModes extends SensorMode
Provide access to the modes supported by a sensor- Author:
- andy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.ArrayList<java.lang.String>getAvailableModes()Return a list of string descriptions for the sensors available modes.intgetCurrentMode()Gets the index number of the current mode.SensorModegetMode(int mode)Return the sample provider interface for the requested modeSensorModegetMode(java.lang.String modeName)Return the sample provider for the request modeintgetModeCount()Gets the number of supported modesvoidsetCurrentMode(int mode)Sets the current mode for fetching samplesvoidsetCurrentMode(java.lang.String modeName)Sets the current mode for fetching samples-
Methods inherited from interface lejos.robotics.SampleProvider
fetchSample, sampleSize
-
Methods inherited from interface lejos.hardware.sensor.SensorMode
getName
-
-
-
-
Method Detail
-
getAvailableModes
java.util.ArrayList<java.lang.String> getAvailableModes()
Return a list of string descriptions for the sensors available modes.- Returns:
- list of string descriptions
-
getMode
SensorMode getMode(int mode)
Return the sample provider interface for the requested mode- Parameters:
mode- the mode number- Returns:
- the sample provider for this mode
-
getMode
SensorMode getMode(java.lang.String modeName)
Return the sample provider for the request mode- Parameters:
modeName- the name/description of the mode- Returns:
- the sample provider for the requested mode.
-
setCurrentMode
void setCurrentMode(int mode)
Sets the current mode for fetching samples- Parameters:
mode- the index number of the mode. Index number corresponds with the item order of the list from getAvailableModes().
-
setCurrentMode
void setCurrentMode(java.lang.String modeName)
Sets the current mode for fetching samples- Parameters:
modeName- the name of the mode. name corresponds with the item value of the list from getAvailableModes().
-
getCurrentMode
int getCurrentMode()
Gets the index number of the current mode.- Returns:
- the index number of the mode. Index number corresponds with the item order of the list from getAvailableModes().
-
getModeCount
int getModeCount()
Gets the number of supported modes- Returns:
- the number of supported modes
-
-