public class YOrientation extends YSensor
| Modifier and Type | Class and Description |
|---|---|
static interface |
YOrientation.TimedReportCallback
TimedReportCallback for Orientation
|
static interface |
YOrientation.UpdateCallback
Deprecated UpdateCallback for Orientation
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
_command |
protected int |
_counterClockwise |
protected YOrientation.TimedReportCallback |
_timedReportCallbackOrientation |
protected YOrientation.UpdateCallback |
_valueCallbackOrientation |
protected double |
_zeroOffset |
static String |
COMMAND_INVALID
invalid command value
|
static int |
COUNTERCLOCKWISE_FALSE
invalid counterClockwise value
|
static int |
COUNTERCLOCKWISE_INVALID |
static int |
COUNTERCLOCKWISE_TRUE |
static double |
ZEROOFFSET_INVALID
invalid zeroOffset value
|
_advMode, _cal, _calibrationParam, _currentRawValue, _currentValue, _highestValue, _iresol, _logFrequency, _lowestValue, _prevTR, _reportFrequency, _resolution, _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 |
YOrientation(String func) |
protected |
YOrientation(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) |
int |
clearCalibration()
Cancels any calibration set with set_calibration.
|
static YOrientation |
FindOrientation(String func)
Retrieves an orientation sensor for a given identifier.
|
static YOrientation |
FindOrientationInContext(YAPIContext yctx,
String func)
Retrieves an orientation sensor for a given identifier in a YAPI context.
|
static YOrientation |
FirstOrientation()
Starts the enumeration of orientation sensors currently accessible.
|
static YOrientation |
FirstOrientationInContext(YAPIContext yctx)
Starts the enumeration of orientation sensors currently accessible.
|
int |
get_Calibration(ArrayList<Double> offsetValues)
Retrieves offset correction data points previously entered using the method
set_calibration.
|
String |
get_command() |
int |
get_counterClockwise()
Returns a value indicating whether the sensor is operating in a counterclockwise direction.
|
double |
get_zeroOffset()
Returns the Offset between the orientation reported by the sensor and the actual orientation.
|
int |
getCounterClockwise()
Returns a value indicating whether the sensor is operating in a counterclockwise direction.
|
double |
getZeroOffset()
Returns the Offset between the orientation reported by the sensor and the actual orientation.
|
YOrientation |
nextOrientation()
Continues the enumeration of orientation sensors started using yFirstOrientation().
|
int |
registerTimedReportCallback(YOrientation.TimedReportCallback callback)
Registers the callback function that is invoked on every periodic timed notification.
|
int |
registerValueCallback(YOrientation.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
sendCommand(String command) |
int |
set_calibration(ArrayList<Double> offsetValues)
Modifies the calibration of the MA600A sensor using an array of 32
values representing the offset in degrees between the true values and
those measured regularly every 11.25 degrees starting from zero.
|
int |
set_command(String newval) |
int |
set_counterClockwise(int newval)
Defines the operating direction of the sensor.
|
int |
set_zeroOffset(double newval)
Sets an offset between the orientation reported by the sensor and the actual orientation.
|
int |
setCounterClockwise(int newval)
Defines the operating direction of the sensor.
|
int |
setZeroOffset(double newval)
Sets an offset between the orientation reported by the sensor and the actual orientation.
|
int |
zero()
Reset the sensor's zero to current position by automatically setting a new offset.
|
_applyCalibration, _decodeAvg, _decodeTimedReport, _decodeVal, _encodeCalibrationPoints, _parseCalibStr, _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, _decode_json_int, _decode_json_string, _download, _escapeAttr, _FindFromCache, _FindFromCacheInContext, _get_json_path_struct, _get_json_path, _is_valid_pass, _json_get_array, _json_get_key, _json_get_string, _parse, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, _uploadEx, 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_serialNumber, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, isReadOnly, load, loadAttribute, module, muteValueCallbacks, nextFunction, registerValueCallback, set_advertisedValue, set_logicalName, set_userData, setLogicalName, setUserData, toString, unmuteValueCallbacks, userDatapublic static final int COUNTERCLOCKWISE_FALSE
public static final int COUNTERCLOCKWISE_TRUE
public static final int COUNTERCLOCKWISE_INVALID
public static final String COMMAND_INVALID
public static final double ZEROOFFSET_INVALID
protected int _counterClockwise
protected String _command
protected double _zeroOffset
protected YOrientation.UpdateCallback _valueCallbackOrientation
protected YOrientation.TimedReportCallback _timedReportCallbackOrientation
protected YOrientation(YAPIContext ctx, String func)
func - : functionidprotected YOrientation(String func)
func - : functionidprotected void _parseAttr(com.yoctopuce.YoctoAPI.YJSONObject json_val)
throws Exception
_parseAttr in class YSensorExceptionpublic int get_counterClockwise()
throws YAPI_Exception
YAPI_Exception - on errorpublic int getCounterClockwise()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_counterClockwise(int newval)
throws YAPI_Exception
newval - : either YOrientation.COUNTERCLOCKWISE_FALSE or YOrientation.COUNTERCLOCKWISE_TRUEYAPI_Exception - on errorpublic int setCounterClockwise(int newval)
throws YAPI_Exception
newval - : either YOrientation.COUNTERCLOCKWISE_FALSE or YOrientation.COUNTERCLOCKWISE_TRUEYAPI_Exception - on errorpublic String get_command() throws YAPI_Exception
YAPI_Exceptionpublic int set_command(String newval) throws YAPI_Exception
YAPI_Exceptionpublic int set_zeroOffset(double newval)
throws YAPI_Exception
newval - : a floating point numberYAPI_Exception - on errorpublic int setZeroOffset(double newval)
throws YAPI_Exception
newval - : a floating point numberYAPI_Exception - on errorpublic double get_zeroOffset()
throws YAPI_Exception
YAPI_Exception - on errorpublic double getZeroOffset()
throws YAPI_Exception
YAPI_Exception - on errorpublic static YOrientation FindOrientation(String func)
func - : a string that uniquely characterizes the orientation sensor, for instance
MyDevice.orientation.public static YOrientation FindOrientationInContext(YAPIContext yctx, String func)
yctx - : a YAPI contextfunc - : a string that uniquely characterizes the orientation sensor, for instance
MyDevice.orientation.public int registerValueCallback(YOrientation.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 YSensorpublic int registerTimedReportCallback(YOrientation.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 YSensorpublic int sendCommand(String command) throws YAPI_Exception
YAPI_Exceptionpublic int zero()
throws YAPI_Exception
YAPI_Exception - on errorpublic int set_calibration(ArrayList<Double> offsetValues) throws YAPI_Exception
offsetValues - : array of 32 floating point values in the [-11.25..+11.25] rangeYAPI_Exception - on errorpublic int get_Calibration(ArrayList<Double> offsetValues) throws YAPI_Exception
offsetValues - : array of 32 floating point numbers, that will be filled by the
function with the offset values for the correction points.YAPI_Exception - on errorpublic int clearCalibration()
throws YAPI_Exception
YAPI_Exception - on errorpublic YOrientation nextOrientation()
public static YOrientation FirstOrientation()
public static YOrientation FirstOrientationInContext(YAPIContext yctx)
yctx - : a YAPI context.Copyright © 2026. All rights reserved.