public class UARTSensor extends BaseSensor
Modifier and Type | Field and Description |
---|---|
protected int |
currentMode |
protected UARTPort |
port |
modes
Constructor and Description |
---|
UARTSensor(Port port)
Standard constructor for a UARTSensor initialises things and places the
device into mode 0.
|
UARTSensor(Port port,
int mode)
Create the sensor object and switch to the selected mode
|
UARTSensor(UARTPort port)
Standard constructor for a UARTSensor initialises things and places the
device into mode 0.
|
UARTSensor(UARTPort port,
int mode)
Create the sensor object and switch to the selected mode
|
Modifier and Type | Method and Description |
---|---|
protected void |
switchMode(int newMode,
long switchDelay)
Switch to the selected mode (if not already in that mode) and delay for the
specified period to allow the sensor to settle in the new mode.
|
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
protected UARTPort port
protected int currentMode
public UARTSensor(UARTPort port)
port
- The port the sensor is attached to.public UARTSensor(Port port)
port
- The port the sensor is attached to.public UARTSensor(UARTPort port, int mode)
port
- The port the sensor is attached to.mode
- Operating mode for the sensor.public UARTSensor(Port port, int mode)
port
- The port the sensor is attached to.mode
- Operating mode for the sensor.protected void switchMode(int newMode, long switchDelay)
newMode
- The mode to switch to.switchDelay
- Time in mS to delay after the switch.