
6. Programming, general concepts
The Yoctopuce API was designed to be at the same time simple to use and sufficiently generic for
the concepts used to be valid for all the modules in the Yoctopuce range, and this in all the available
programming languages. Therefore, when you have understood how to drive your Yocto-
RangeFinder with your favorite programming language, learning to use another module, even with a
different language, will most likely take you only a minimum of time.
6.1. Programming paradigm
The Yoctopuce API is object oriented. However, for simplicity's sake, only the basics of object
programming were used. Even if you are not familiar with object programming, it is unlikely that this
will be a hinderance for using Yoctopuce products. Note that you will never need to allocate or
deallocate an object linked to the Yoctopuce API: it is automatically managed.
There is one class per Yoctopuce function type. The name of these classes always starts with a Y
followed by the name of the function, for example
YTemperature
,
YRelay
,
YPressure
, etc.. There is
also a
YModule
class, dedicated to managing the modules themselves, and finally there is the static
YAPI class, that supervises the global workings of the API and manages low level communications.
Structure of the Yoctopuce API.
The YSensor class
Each Yoctopuce sensor function has its dedicated class: YTemperature to measure the temperature,
YVoltage to measure a voltage, YRelay to drive a relay, etc. However there is a special class that
can do more: YSensor.
www.yoctopuce.com
21
Содержание 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: ......