public class PrototypeSensor extends Sensor
Constructor and Description |
---|
PrototypeSensor()
Creates a sensor instance connected to port S1.
|
PrototypeSensor(SensorPort port)
Creates a sensor instance connected to the given port.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getProductID()
Returns the product identifier (if available).
|
java.lang.String |
getVersion()
Returns the sensor version number (if available).
|
void |
read(int[] ain,
int[] din)
Reads the sensor.
|
void |
readAnalog(int[] ain)
Reads the sensor.
|
void |
readDigital(int[] din)
Reads the sensor.
|
void |
setDIOMask(int mask)
Sets the direction of the 6 digital input/output channels.
|
void |
setSamplingPeriod(int period)
Sets the sampling period of the ADC (4..100 ms, default 4 ms).
|
void |
writeByte(int value)
Writes the given byte to the digital output channels.
|
public PrototypeSensor(SensorPort port)
port
- the port where the sensor is plugged-inpublic PrototypeSensor()
public void setDIOMask(int mask)
mask
- the bit maskpublic void readAnalog(int[] ain)
ain
- an integer array of length 5 where to get the analog valuespublic void readDigital(int[] din)
din
- an integer array of length 6 where to get the digital valuespublic void read(int[] ain, int[] din)
ain
- an integer array of length 5 where to get the analog valuesdin
- an integer array of length 6 where to get the digital valuespublic void writeByte(int value)
value
- a byte (lower 8 bits of int) that holds the bit state: 0->low, 1->high.
Only bit 0 to bit 5 are used.public void setSamplingPeriod(int period)
period
- the new sampling periodpublic java.lang.String getProductID()
public java.lang.String getVersion()