
21. High-level API Reference
21.5. LightSensor function interface
The Yoctopuce class YLightSensor allows you to read and configure Yoctopuce light sensors. It inherits
from YSensor class the core functions to read measurements, to register callback functions, to access
the autonomous datalogger. This class adds the ability to easily perform a one-point linear calibration to
compensate the effect of a glass or filter placed in front of the sensor. For some light sensors with
several working modes, this class can select the desired working mode.
In order to use the functions described here, you should include:
js
<script type='text/javascript' src='yocto_lightsensor.js'></script>
cpp
#include "yocto_lightsensor.h"
m
#import "yocto_lightsensor.h"
pas
uses yocto_lightsensor;
vb
yocto_lightsensor.vb
cs
yocto_lightsensor.cs
java
import com.yoctopuce.YoctoAPI.YLightSensor;
uwp
import com.yoctopuce.YoctoAPI.YLightSensor;
py
from yocto_lightsensor import *
php
require_once('yocto_lightsensor.php');
es
in HTML: <script src="../../lib/yocto_lightsensor.js"></script>
in node.js: require('yoctolib-es2017/yocto_lightsensor.js');
Global functions
func
)
Retrieves a light sensor for a given identifier.
yctx
,
func
)
Retrieves a light sensor for a given identifier in a YAPI context.
Starts the enumeration of light sensors currently accessible.
yctx
)
Starts the enumeration of light sensors currently accessible.
YLightSensor
methods
calibratedVal
)
Changes the sensor-specific calibration parameter so that the current value matches a desired target (linear
scaling).
rawValues
,
refValues
)
Configures error correction data points, in particular to compensate for a possible perturbation of the measure
caused by an enclosure.
Invalidates the cache.
Returns a short text that describes unambiguously the instance of the light sensor in the form
TYPE(NAME)=SERIAL.FUNCTIONID
.
Returns the current value of the light sensor (no more than 6 characters).
Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point
number.
www.yoctopuce.com
357
Содержание Yocto-RangeFinder
Страница 1: ...Yocto RangeFinder User s guide...
Страница 2: ......
Страница 18: ...12 www yoctopuce com...
Страница 26: ...20 www yoctopuce com...
Страница 42: ...36 www yoctopuce com...
Страница 70: ...gcc lyocto lm lpthread lusb 1 0 lstdc 10 Using Yocto RangeFinder with C 64 www yoctopuce com...
Страница 90: ...84 www yoctopuce com...
Страница 120: ...114 www yoctopuce com...
Страница 130: ...124 www yoctopuce com...
Страница 158: ...21 High level API Reference On failure throws an exception or returns a negative error code 152 www yoctopuce com...
Страница 484: ...478 www yoctopuce com...
Страница 488: ...482 www yoctopuce com...
Страница 490: ...23 Characteristics 484 www yoctopuce com...
Страница 491: ......
Страница 492: ......