// Next calls to loadMore() will retrieve measures
Console
.
WriteLine
(
"loading details"
)
;
int
progress;
do
{
Console
.
Write
(
"."
)
;
progress = dataset.
loadMore
()
;
}
while(
progress <
100
)
;
// All measures have now been loaded
List<YMeasure> details = dataset.
get_measures
()
;
foreach
(
YMeasure m
in
details
)
{
Console
.
WriteLine
(
String.
Format
(
logFmt,
m.
get_startTimeUTC_asDateTime
()
.
ToString
(
timeFmt
)
,
m.
get_endTimeUTC_asDateTime
()
.
ToString
(
timeFmt
)
,
m.
get_averageValue
()
, sensor.
get_unit
()))
;
}
You will find a complete example demonstrating how to retrieve data from the logger for each
programming language directly in the Yoctopuce library. The example can be found in directory
Examples/Prog-DataLogger
.
Timestamp
As the Yocto-RangeFinder does not have a battery, it cannot guess alone the current time when
powered on. Nevertheless, the Yocto-RangeFinder will automatically try to adjust its real-time
reference using the host to which it is connected, in order to properly attach a timestamp to each
measure in the datalogger:
• When the Yocto-RangeFinder is connected to a computer running either the VirtualHub or any
application using the Yoctopuce library, it will automatically receive the time from this
computer.
• When the Yocto-RangeFinder is connected to a YoctoHub-Ethernet, it will get the time that the
YoctoHub has obtained from the network (using a server from
pool.ntp.org
)
• When the Yocto-RangeFinder is connected to a YoctoHub-Wireless, it will get the time
provided by the YoctoHub based on its internal battery-powered real-time clock, which was
itself configured either from the network or from a computer
• When the Yocto-RangeFinder is connected to an Android mobile device, it will get the time
from the mobile device as long as an app using the Yoctopuce library is launched.
When none of these conditions applies (for instance if the module is simply connected to an USB
charger), the Yocto-RangeFinder will do its best effort to attach a reasonable timestamp to the
measures, using the timestamp found on the latest recorded measures. It is therefore possible to
"preset to the real time" an autonomous Yocto-RangeFinder by connecting it to an Android mobile
phone, starting the data logger, then connecting the device alone on an USB charger. Nevertheless,
be aware that without external time source, the internal clock of the Yocto-RangeFinder might be be
subject to a clock skew (theoretically up to 0.3%).
18.3. Sensor calibration
Your Yocto-RangeFinder module is equipped with a digital sensor calibrated at the factory. The
values it returns are supposed to be reasonably correct in most cases. There are, however,
situations where external conditions can impact the measures.
The Yoctopuce API provides the mean to re-caliber the values measured by your Yocto-
RangeFinder. You are not going to modify the hardware settings of the module, but rather to
transform afterwards the measures taken by the sensor. This transformation is controlled by
parameters stored in the flash memory of the module, making it specific for each module. This re-
calibration is therefore a fully software matter and remains perfectly reversible.
Before deciding to re-calibrate your Yocto-RangeFinder module, make sure you have well
understood the phenomena which impact the measures of your module, and that the differences
between true values and measured values do not result from a incorrect use or an inadequate
location of the module.
18. Advanced programming
120
www.yoctopuce.com
Содержание 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: ......