7. 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-Display 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.
7.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
Summary of Contents for Yocto-Display
Page 1: ...Yocto Display User Manual...
Page 2: ......
Page 40: ...34 www yoctopuce com...
Page 52: ...46 www yoctopuce com...
Page 84: ...78 www yoctopuce com...
Page 92: ...86 www yoctopuce com...
Page 130: ...124 www yoctopuce com...
Page 422: ...416 www yoctopuce com...