public class YAccelerometer extends YSensor
Modifier and Type | Class and Description |
---|---|
static interface |
YAccelerometer.TimedReportCallback
TimedReportCallback for Accelerometer
|
static interface |
YAccelerometer.UpdateCallback
Deprecated UpdateCallback for Accelerometer
|
Modifier and Type | Field and Description |
---|---|
protected int |
_bandwidth |
protected int |
_gravityCancellation |
protected YAccelerometer.TimedReportCallback |
_timedReportCallbackAccelerometer |
protected YAccelerometer.UpdateCallback |
_valueCallbackAccelerometer |
protected double |
_xValue |
protected double |
_yValue |
protected double |
_zValue |
static int |
BANDWIDTH_INVALID
invalid bandwidth value
|
static int |
GRAVITYCANCELLATION_INVALID |
static int |
GRAVITYCANCELLATION_OFF
invalid gravityCancellation value
|
static int |
GRAVITYCANCELLATION_ON |
static double |
XVALUE_INVALID
invalid xValue value
|
static double |
YVALUE_INVALID
invalid yValue value
|
static double |
ZVALUE_INVALID
invalid zValue value
|
_advMode, _calhdl, _calibrationParam, _calpar, _calraw, _calref, _caltyp, _currentRawValue, _currentValue, _decexp, _highestValue, _iresol, _isScal, _isScal32, _logFrequency, _lowestValue, _offset, _prevTimedReport, _reportFrequency, _resolution, _scale, _sensorState, _timedReportCallbackSensor, _unit, _valueCallbackSensor, ADVMODE_IMMEDIATE, ADVMODE_INVALID, ADVMODE_PERIOD_AVG, ADVMODE_PERIOD_MAX, ADVMODE_PERIOD_MIN, CALIBRATIONPARAM_INVALID, CURRENTRAWVALUE_INVALID, CURRENTVALUE_INVALID, HIGHESTVALUE_INVALID, LOGFREQUENCY_INVALID, LOWESTVALUE_INVALID, REPORTFREQUENCY_INVALID, RESOLUTION_INVALID, SENSORSTATE_INVALID, UNIT_INVALID
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, _yapi, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YAccelerometer(String func) |
protected |
YAccelerometer(YAPIContext ctx,
String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeTimedReportCallback(YMeasure value) |
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) |
static YAccelerometer |
FindAccelerometer(String func)
Retrieves an accelerometer for a given identifier.
|
static YAccelerometer |
FindAccelerometerInContext(YAPIContext yctx,
String func)
Retrieves an accelerometer for a given identifier in a YAPI context.
|
static YAccelerometer |
FirstAccelerometer()
Starts the enumeration of accelerometers currently accessible.
|
static YAccelerometer |
FirstAccelerometerInContext(YAPIContext yctx)
Starts the enumeration of accelerometers currently accessible.
|
int |
get_bandwidth()
Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).
|
int |
get_gravityCancellation() |
double |
get_xValue()
Returns the X component of the acceleration, as a floating point number.
|
double |
get_yValue()
Returns the Y component of the acceleration, as a floating point number.
|
double |
get_zValue()
Returns the Z component of the acceleration, as a floating point number.
|
int |
getBandwidth()
Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).
|
double |
getXValue()
Returns the X component of the acceleration, as a floating point number.
|
double |
getYValue()
Returns the Y component of the acceleration, as a floating point number.
|
double |
getZValue()
Returns the Z component of the acceleration, as a floating point number.
|
YAccelerometer |
nextAccelerometer()
Continues the enumeration of accelerometers started using yFirstAccelerometer().
|
int |
registerTimedReportCallback(YAccelerometer.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YAccelerometer.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
set_bandwidth(int newval)
Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).
|
int |
set_gravityCancellation(int newval) |
int |
setBandwidth(int newval)
Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).
|
_applyCalibration, _decodeAvg, _decodeTimedReport, _decodeVal, _encodeCalibrationPoints, _parserHelper, calibrateFromPoints, FindSensor, FindSensorInContext, FirstSensor, FirstSensorInContext, get_advMode, get_calibrationParam, get_currentRawValue, get_currentValue, get_dataLogger, get_highestValue, get_logFrequency, get_lowestValue, get_recordedData, get_reportFrequency, get_resolution, get_sensorState, get_unit, getAdvMode, getCurrentRawValue, getCurrentValue, getHighestValue, getLogFrequency, getLowestValue, getReportFrequency, getResolution, getSensorState, getUnit, isSensorReady, loadCalibrationPoints, nextSensor, registerTimedReportCallback, registerValueCallback, set_advMode, set_calibrationParam, set_highestValue, set_logFrequency, set_lowestValue, set_reportFrequency, set_resolution, setAdvMode, setHighestValue, setLogFrequency, setLowestValue, setReportFrequency, setResolution, startDataLogger, stopDataLogger
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FindFunctionInContext, FirstFunction, FirstFunctionInContext, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userData
public static final int BANDWIDTH_INVALID
public static final double XVALUE_INVALID
public static final double YVALUE_INVALID
public static final double ZVALUE_INVALID
public static final int GRAVITYCANCELLATION_OFF
public static final int GRAVITYCANCELLATION_ON
public static final int GRAVITYCANCELLATION_INVALID
protected int _bandwidth
protected double _xValue
protected double _yValue
protected double _zValue
protected int _gravityCancellation
protected YAccelerometer.UpdateCallback _valueCallbackAccelerometer
protected YAccelerometer.TimedReportCallback _timedReportCallbackAccelerometer
protected YAccelerometer(YAPIContext ctx, String func)
func
- : functionidprotected YAccelerometer(String func)
func
- : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val) throws Exception
_parseAttr
in class YSensor
Exception
public int get_bandwidth() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBandwidth() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_bandwidth(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)YAPI_Exception
- on errorpublic int setBandwidth(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)YAPI_Exception
- on errorpublic double get_xValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getXValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_yValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getYValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double get_zValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic double getZValue() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_gravityCancellation() throws YAPI_Exception
YAPI_Exception
public int set_gravityCancellation(int newval) throws YAPI_Exception
YAPI_Exception
public static YAccelerometer FindAccelerometer(String func)
func
- : a string that uniquely characterizes the accelerometerpublic static YAccelerometer FindAccelerometerInContext(YAPIContext yctx, String func)
yctx
- : a YAPI contextfunc
- : a string that uniquely characterizes the accelerometerpublic int registerValueCallback(YAccelerometer.UpdateCallback callback)
callback
- : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback
in class YSensor
public int registerTimedReportCallback(YAccelerometer.TimedReportCallback callback)
callback
- : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and an YMeasure object describing
the new advertised value.public int _invokeTimedReportCallback(YMeasure value)
_invokeTimedReportCallback
in class YSensor
public YAccelerometer nextAccelerometer()
public static YAccelerometer FirstAccelerometer()
public static YAccelerometer FirstAccelerometerInContext(YAPIContext yctx)
yctx
- : a YAPI context.Copyright © 2018. All rights reserved.