All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pbsim.Sensor

java.lang.Object
   |
   +----pbsim.Sensor

public class Sensor
extends java.lang.Object

Variable Index

 o ILLEGAL_TEMP_VALUE
 o MAX_CUMULATIVE_VALUE
 o MAX_RAW_VALUE
 o MIN_CUMULATIVE_VALUE
 o MODE_BOOL
 o MODE_CELSIUS
 o MODE_EDGE
 o MODE_FAHRENHEIT
 o MODE_MASK
 o MODE_PERCENT
 o MODE_PULSE
 o MODE_RAW
 o MODE_ROTATION
 o SLOPE_MASK
 o TYPE_LIGHT
 o TYPE_NONE
 o TYPE_ROTATION
 o TYPE_TEMPERATURE
 o TYPE_TOUCH

Method Index

 o getBoolValue()
 o getId()
 o getMode()
 o getRawValue()
 o getType()
 o getValue()
 o percentToRaw(int)
convert a percent back to a raw value.
 o setCumulativeValue(int)
set the processed value of a sensor that is in a cumulative mode (MODE_ROTATION, MODE_EDGE, or MODE_PULSE).
 o setListener(SensorListener)
 o setRawValue(int)
set the raw value of a sensor.

Variables

 o MAX_RAW_VALUE
 public static final int MAX_RAW_VALUE
 o MAX_CUMULATIVE_VALUE
 public static final int MAX_CUMULATIVE_VALUE
 o MIN_CUMULATIVE_VALUE
 public static final int MIN_CUMULATIVE_VALUE
 o ILLEGAL_TEMP_VALUE
 public static final int ILLEGAL_TEMP_VALUE
 o TYPE_NONE
 public static final int TYPE_NONE
 o TYPE_TOUCH
 public static final int TYPE_TOUCH
 o TYPE_TEMPERATURE
 public static final int TYPE_TEMPERATURE
 o TYPE_LIGHT
 public static final int TYPE_LIGHT
 o TYPE_ROTATION
 public static final int TYPE_ROTATION
 o MODE_RAW
 public static final int MODE_RAW
 o MODE_BOOL
 public static final int MODE_BOOL
 o MODE_EDGE
 public static final int MODE_EDGE
 o MODE_PULSE
 public static final int MODE_PULSE
 o MODE_PERCENT
 public static final int MODE_PERCENT
 o MODE_CELSIUS
 public static final int MODE_CELSIUS
 o MODE_FAHRENHEIT
 public static final int MODE_FAHRENHEIT
 o MODE_ROTATION
 public static final int MODE_ROTATION
 o MODE_MASK
 public static final int MODE_MASK
 o SLOPE_MASK
 public static final int SLOPE_MASK

Methods

 o getId
 public int getId()
 o getValue
 public int getValue()
 o getRawValue
 public int getRawValue()
 o getBoolValue
 public int getBoolValue()
 o getMode
 public int getMode()
 o getType
 public int getType()
 o setListener
 public void setListener(pbsim.SensorListener l)
 o setRawValue
 public synchronized void setRawValue(int v)
set the raw value of a sensor. The new value won't take effect until the next time the sensor is sampled (normally every time PBrick.step() is called).

 o setCumulativeValue
 public synchronized void setCumulativeValue(int v)
set the processed value of a sensor that is in a cumulative mode (MODE_ROTATION, MODE_EDGE, or MODE_PULSE). This call is especially convenient when working with rotation sensors since sending the correct sequence of raw values to represent rotation through quadrants is quite tedious. The new value does not take effect until the next time the sensor is sampled.

 o percentToRaw
 public static int percentToRaw(int percent)
convert a percent back to a raw value. This method can be used to determine a raw sensor value that will yield the specified percentage when a sensor is in SENSOR_MODE_PERCENT mode.

Parameters:
percent - desired percentage
Returns:
s raw value

All Packages  Class Hierarchy  This Package  Previous  Next  Index