public class Accelerometer extends Sensor implements AccelerometerSensor
simulatedOnly, validLoad
Constructor and Description |
---|
Accelerometer()
Loads the default connected sensor
|
Modifier and Type | Method and Description |
---|---|
double[] |
getAccelerometerData() |
float |
getAccelerometerX() |
float |
getAccelerometerY() |
float |
getAccelerometerZ() |
java.lang.String |
getSensorName()
Returns the sensor name, typically the make/model of the hardware sensor that this class refers to.
|
void |
reloadSimulation()
Override this on any classes you need to do something as a simulated sensor
|
void |
resetToDefault()
Remove all rounding
|
Accelerometer |
setRounding(int resolution)
Set the resolution for all three axis to the number of decimal places
set by resolution.
|
void |
setXRounding(int resolution)
Set the resolution for X axis to the number of decimal places
set by resolution.
|
void |
setYRounding(int resolution)
Set the resolution for Y axis to the number of decimal places
set by resolution.
|
void |
setZRounding(int resolution)
Set the resolution for Z axis to the number of decimal places
set by resolution.
|
addListener, addNonResettableListener, addNonResettableValueChangedListener, addValueChangedListener, clearListeners, getSensor, isSimulatedOnly, isValidLoadedSensor, notifyListeners, removeListener, removeListener, roundValue, scaleValue, setSimulatedOnly, setValidLoad, storeSensor
public void resetToDefault()
resetToDefault
in class Sensor
public Accelerometer setRounding(int resolution)
resolution
- the number of decimal places to round to. -1 will be no roundingpublic void setXRounding(int resolution)
resolution
- the number of decimal places to round to. -1 will be no roundingpublic void setYRounding(int resolution)
resolution
- the number of decimal places to round to. -1 will be no roundingpublic void setZRounding(int resolution)
resolution
- the number of decimal places to round to. -1 will be no roundingpublic void reloadSimulation()
Sensor
reloadSimulation
in class Sensor
public java.lang.String getSensorName()
Sensor
getSensorName
in class Sensor
String
representing the sensor's name.public double[] getAccelerometerData()
getAccelerometerData
in interface AccelerometerSensor
public float getAccelerometerX()
getAccelerometerX
in interface AccelerometerSensor
public float getAccelerometerY()
getAccelerometerY
in interface AccelerometerSensor
public float getAccelerometerZ()
getAccelerometerZ
in interface AccelerometerSensor