Yoctopuce Yocto-Display User manual

Yocto-Display
User Manual


www.yoctopuce.com III
Table of contents
1. Introduction 1...............................................................................................................................
1.1. Safety Information 2...............................................................................................................
1.2. Environmental conditions 2...................................................................................................
2. Presentation 3..............................................................................................................................
2.1. Common elements 3...............................................................................................................
2.2. Specific elements 4................................................................................................................
2.3. Optional accessories 5...........................................................................................................
3. Working principles 7................................................................................................................
3.1. Embedded processor and memory 7....................................................................................
3.2. Orientation 7............................................................................................................................
3.3. Layer system 7........................................................................................................................
3.4. Graphic routines 8..................................................................................................................
3.5. Text display 9..........................................................................................................................
3.6. Font file format 10...................................................................................................................
3.7. Sequences and animations 11...............................................................................................
3.8. Optimizations 11.....................................................................................................................
4. The embedded file system 13.............................................................................................
4.1. Usage 13..................................................................................................................................
4.2. Limitations 14..........................................................................................................................
5. First steps 15................................................................................................................................
5.1. Prerequisites 15......................................................................................................................
5.2. Testing USB connectivity 16..................................................................................................
5.3. Localization 17........................................................................................................................
5.4. Test of the module 17.............................................................................................................
5.5. Configuration 17.....................................................................................................................
6. Assembly and connections 19...........................................................................................
6.1. Fixing 19..................................................................................................................................
6.2. USB power distribution 19.....................................................................................................

IV www.yoctopuce.com
7. Programming, general concepts 21.................................................................................
7.1. Programming paradigm 21....................................................................................................
7.2. The Yocto-Display module 23................................................................................................
7.3. Module control interface 24...................................................................................................
7.4. Display function interface 25.................................................................................................
7.5. AnButton function interface 26.............................................................................................
7.6. Files function interface 27......................................................................................................
7.7. What interface: Native, DLL or Service ? 28.........................................................................
7.8. Programming, where to start? 30..........................................................................................
8. Using the Yocto-Display in command line 31............................................................
8.1. Installing 31.............................................................................................................................
8.2. Use: general description 31...................................................................................................
8.3. Control of the Display function 32........................................................................................
8.4. Control of the module part 32................................................................................................
8.5. Limitations 33..........................................................................................................................
9. Using Yocto-Display with JavaScript / EcmaScript 35..........................................
9.1. Blocking I/O versus Asynchronous I/O in JavaScript 35....................................................
9.2. Using Yoctopuce library for JavaScript / EcmaScript 2017 36...........................................
9.3. Control of the Display function 38........................................................................................
9.4. Control of the module part 42................................................................................................
9.5. Error handling 44....................................................................................................................
10. Using Yocto-Display with PHP 47..................................................................................
10.1. Getting ready 47....................................................................................................................
10.2. Control of the Display function 47......................................................................................
10.3. Control of the module part 49..............................................................................................
10.4. HTTP callback API and NAT filters 52.................................................................................
10.5. Error handling 55..................................................................................................................
11. Using Yocto-Display with C++ 57...................................................................................
11.1. Control of the Display function 57......................................................................................
11.2. Control of the module part 60..............................................................................................
11.3. Error handling 62..................................................................................................................
11.4. Integration variants for the C++ Yoctopuce library 63......................................................
12. Using Yocto-Display with Objective-C 65..................................................................
12.1. Control of the Display function 65......................................................................................
12.2. Control of the module part 67..............................................................................................
12.3. Error handling 69..................................................................................................................
13. Using Yocto-Display with Visual Basic .NET 71.....................................................
13.1. Installation 71........................................................................................................................
13.2. Using the Yoctopuce API in a Visual Basic project 71......................................................
13.3. Control of the Display function 72......................................................................................
13.4. Control of the module part 74..............................................................................................
13.5. Error handling 76..................................................................................................................
14. Using Yocto-Display with C# 79......................................................................................
14.1. Installation 79........................................................................................................................

www.yoctopuce.com V
14.2. Using the Yoctopuce API in a Visual C# project 79...........................................................
14.3. Control of the Display function 80......................................................................................
14.4. Control of the module part 82..............................................................................................
14.5. Error handling 85..................................................................................................................
15. Using the Yocto-Display with Universal Windows Platform 87.....................
15.1. Blocking and asynchronous functions 87..........................................................................
15.2. Installation 88........................................................................................................................
15.3. Using the Yoctopuce API in a Visual Studio project 88....................................................
15.4. Control of the Display function 89......................................................................................
15.5. A real example 89.................................................................................................................
15.6. Control of the module part 91..............................................................................................
15.7. Error handling 93..................................................................................................................
16. Using Yocto-Display with Delphi 95..............................................................................
16.1. Preparation 95.......................................................................................................................
16.2. Control of the Display function 95......................................................................................
16.3. Control of the module part 97..............................................................................................
16.4. Error handling 100................................................................................................................
17. Using the Yocto-Display with Python 101.................................................................
17.1. Source files 101....................................................................................................................
17.2. Dynamic library 101..............................................................................................................
17.3. Control of the Display function 101....................................................................................
17.4. Control of the module part 104............................................................................................
17.5. Error handling 105................................................................................................................
18. Using the Yocto-Display with Java 107.......................................................................
18.1. Getting ready 107..................................................................................................................
18.2. Control of the Display function 107....................................................................................
18.3. Control of the module part 110............................................................................................
18.4. Error handling 112................................................................................................................
19. Using the Yocto-Display with Android 113...............................................................
19.1. Native access and VirtualHub 113.......................................................................................
19.2. Getting ready 113..................................................................................................................
19.3. Compatibility 113..................................................................................................................
19.4. Activating the USB port under Android 114.......................................................................
19.5. Control of the Display function 116....................................................................................
19.6. Control of the module part 118............................................................................................
19.7. Error handling 123................................................................................................................
20. Advanced programming 125.............................................................................................
20.1. Event programming 125.......................................................................................................
21. Using with unsupported languages 127.....................................................................
21.1. Command line 127................................................................................................................
21.2. VirtualHub and HTTP GET 127.............................................................................................
21.3. Using dynamic libraries 129................................................................................................
21.4. Porting the high level library 132........................................................................................
22. High-level API Reference 133...........................................................................................

VI www.yoctopuce.com
22.1. General functions 134..........................................................................................................
22.2. Module control interface 169...............................................................................................
22.3. Display function interface 235.............................................................................................
22.4. DisplayLayer object interface 292.......................................................................................
22.5. AnButton function interface 324.........................................................................................
22.6. Files function interface 372..................................................................................................
23. Troubleshooting 413..............................................................................................................
23.1. Where to start? 413..............................................................................................................
23.2. Programming examples don't seem to work 413..............................................................
23.3. Linux and USB 413...............................................................................................................
23.4. ARM Platforms: HF and EL 414...........................................................................................
23.5. Powered module but invisible for the OS 414....................................................................
23.6. Another process named xxx is already using yAPI 414....................................................
23.7. Disconnections, erratic behavior 414.................................................................................
23.8. Damaged device 415............................................................................................................
24. Characteristics 417.................................................................................................................

1. Introduction
The Yocto-Display is a 66x58mm electronic module allowing you to drive a 128 x 32px monochrome
OLED screen, as well as 6 channels which can measure the state of switches, push buttons, or even
potentiometers. This screen enables you to easily display some easily readable pieces of information
from a machine which does not usually have a monitor.
The Yocto-Display module
The Yocto-Display is not in itself a complete product. It is a component intended to be integrated into
a solution used in laboratory equipments, or in industrial process-control equipments, or for similar
applications in domestic and commercial environments. In order to use it, you must at least install it
in a protective enclosure and connect it to a host computer.
Yoctopuce thanks you for buying this Yocto-Display and sincerely hopes that you will be satisfied
with it. The Yoctopuce engineers have put a large amount of effort to ensure that your Yocto-Display
is easy to install anywhere and easy to drive from a maximum of programming languages. If you are
nevertheless disappointed with this module, or if you need additional information, do not hesitate to
contact Yoctopuce support:
Web site: www.yoctopuce.com
Postal address: Chemin des Journaliers, 1
ZIP code, city: 1236 Cartigny
Country: Switzerland
www.yoctopuce.com 1

1.1. Safety Information
The Yocto-Display is designed to meet the requirements of IEC 61010-1:2010 safety standard. It
does not create any serious hazards to the operator and surrounding area, even in single fault
condition, as long as it is integrated and used according to the instructions contained in this
documentation, and in this section in particular.
Protective enclosure
The Yocto-Display should not be used without a protective enclosure, because of the accessible
bare electronic components. For optimal safety, it should be put into a non-metallic, non-inflammable
enclosure, resistant to a mechanical stress level of 5 J. For instance, use a polycarbonate (e.g.
LEXAN) enclosure rated IK08 with a IEC 60695-11-10 flammability rating of V-1 or better. Using a
lower quality enclosure may require specific warnings for the operator and/or compromise conformity
with the safety standard.
Maintenance
If a damage is observed on the electronic board or on the enclosure, it should be replaced in order to
ensure continued safety of the equipment, and to prevent damaging other parts of the system due to
overload that a short circuit could cause.
Identification
In order to ease the maintenance and the identification of risks during maintenance, you should
affixate the water-resistant identification label provided together with the electronic board as close as
possible to the device. If the device is put in a dedicated enclosure, the identification label should be
affixated on the outside of the enclosure.
Application
The safety standard applied is intended to cover laboratory equipment, industrial process-control
equipment and similar applications in residential or commercial environment. If you intend to use the
Yocto-Display for another kind of application, you should check the safety regulations according to
the standard applicable to your application.
In particular, the Yocto-Display is not certified for use in medical environments or for life-support
applications.
Environment
The Yocto-Display is not certified for use in hazardous locations, explosive environments, or life-
threatening applications. Environmental ratings are provided below.
1.2. Environmental conditions
Yoctopuce devices have been designed for indoor use in a standard office or laboratory environment
(IEC 60664 pollution degree 2): air pollution is expected to be limited and mainly non-conductive.
Relative humidity is expected to be between 10% and 90% RH, non condensing. Use in
environments with significant solid pollution or conductive pollution requires a protection from such
pollution using an IP67 or IP68 enclosure. The products are designed for use up to altitude 2000m.
All Yoctopuce devices are warranted to perform according to their documentation and technical
specifications under normal temperature conditions according to IEC61010-1, i.e. 5°C to 40°C. In
addition, most devices can also be used on an extended temperature range, where some limitations
may apply from case to case.
The extended operating temperature range for the Yocto-Display is -25...70°C. This temperature
range has been determined based on components manufacturer recommendations, and on
controlled environment tests performed during a limited duration (1h). If you plan to use the Yocto-
Display in harsh environments for a long period of time, we strongly advise you to run extensive tests
before going to production.
1. Introduction
2 www.yoctopuce.com

2. Presentation
1: Micro-B USB socket 4: Test anButtons 1 to 6
2: Yocto-button 5: anButtons inputs 1 to 6
3: Yocto-led 6: Common ground
2.1. Common elements
All Yocto-modules share a number of common functionalities.
USB connector
Yoctopuce modules all come with a USB 2.0 micro-B socket. Warning: the USB connector is simply
soldered in surface and can be pulled out if the USB plug acts as a lever. In this case, if the tracks
stayed in position, the connector can be soldered back with a good iron and using flux to avoid
bridges. Alternatively, you can solder a USB cable directly in the 1.27mm-spaced holes near the
connector.
If you plan to use a power source other then a standard USB host port to power the device through
the USB connector, that power source must respect the assigned values of USB 2.0 specifications:
•Voltage min.: 4.75 V DC
•Voltage max.: 5.25 V DC
•Over-current protection: 5.0 A max.
www.yoctopuce.com 3

Yocto-button
The Yocto-button has two functionalities. First, it can activate the Yocto-beacon mode (see below
under Yocto-led). Second, if you plug in a Yocto-module while keeping this button pressed, you can
then reprogram its firmware with a new version. Note that there is a simpler UI-based method to
update the firmware, but this one works even in case of severely damaged firmware.
Yocto-led
Normally, the Yocto-led is used to indicate that the module is working smoothly. The Yocto-led then
emits a low blue light which varies slowly, mimicking breathing. The Yocto-led stops breathing when
the module is not communicating any more, as for instance when powered by a USB hub which is
disconnected from any active computer.
When you press the Yocto-button, the Yocto-led switches to Yocto-beacon mode. It starts flashing
faster with a stronger light, in order to facilitate the localization of a module when you have several
identical ones. It is indeed possible to trigger off the Yocto-beacon by software, as it is possible to
detect by software that a Yocto-beacon is on.
The Yocto-led has a third functionality, which is less pleasant: when the internal software which
controls the module encounters a fatal error, the Yocto-led starts emitting an SOS in morse 1. If this
happens, unplug and re-plug the module. If it happens again, check that the module contains the
latest version of the firmware, and, if it is the case, contact Yoctopuce support2.
Current sensor
Each Yocto-module is able to measure its own current consumption on the USB bus. Current supply
on a USB bus being quite critical, this functionality can be of great help. You can only view the
current consumption of a module by software.
Serial number
Each Yocto-module has a unique serial number assigned to it at the factory. For Yocto-Display
modules, this number starts with YD128X32. The module can be software driven using this serial
number. The serial number cannot be modified.
Logical name
The logical name is similar to the serial number: it is a supposedly unique character string which
allows you to reference your module by software. However, in the opposite of the serial number, the
logical name can be modified at will. The benefit is to enable you to build several copies of the same
project without needing to modify the driving software. You only need to program the same logical
name in each copy. Warning: the behavior of a project becomes unpredictable when it contains
several modules with the same logical name and when the driving software tries to access one of
these modules through its logical name. When leaving the factory, modules do not have an assigned
logical name. It is yours to define.
2.2. Specific elements
The screen
The screen is an OLED screen manufactured by WiseChip under the UG-2832ALBCG01 reference.
Being made of glass, it is rather fragile. Do not let your Yocto-Display drop. When you install your
Yocto-Display, make sure that the screen is not subjected to any mechanical constraint. Moreover,
the ribbon coming out of the screen is particularly fragile at its junction with the screen. Make sure it
is not subject to any mechanical constraint. When you manipulate the Yocto-Display, do not press on
the ribbon.
1 short-short-short long-long-long short-short-short
2. Presentation
4 www.yoctopuce.com

Inputs 1 to 6
The Yocto-Display module contains 6 inputs allowing you to measure the state of resistive
components (switches, push buttons, potentiometers, and so on). These inputs share a common
ground. This means that each switch / push button / potentiometer must be connected both to the
corresponding input and to the common ground. You can use any potentiometer value between 1KΩ
and 200 KΩ.
Wiring of a potentiometer, a switch, and a push button, with a common ground.
The measurement circuit is a safety extra low voltage (SELV) circuit. It should not be connected to
any external voltage source, but only be connected to passive components. In no event shall it be
connected to mains circuits.
You will probably want to solder a connector at the designed location. To access the pads, remove
the screws located at the back of your Yocto-Display, delicately move the screen aside, and solder
your connector. Then put the screen back in position.
Potentiometers and calibration
This module allows you to use a wide range of potentiometer values. But to enable it to provide you
with coherent measures for the model you are using, you must calibrate the corresponding channels.
You can do this very easily thanks to the configuration interface. You do not need to perform a
calibration if you use only simple switches or push buttons.
Test push buttons
Each channel has its own small push button allowing you to artificially close the corresponding
circuit. This is helpful to debug your projects.
2.3. Optional accessories
The accessories below are not necessary to use the Yocto-Display module but might be useful
depending on your project. These are mostly common products that you can buy from your favorite
hacking store. To save you the tedious job of looking for them, most of them are also available on the
Yoctopuce shop.
Screws and spacers
In order to mount the Yocto-Display module, you can put small screws in the 3mm assembly holes,
with a screw head no larger than 8mm. The best way is to use threaded spacers, which you can then
mount wherever you want. You can find more details on this topic in the chapter about assembly and
connections.
Micro-USB hub
If you intend to put several Yoctopuce modules in a very small space, you can connect them directly
to a micro-USB hub. Yoctopuce builds a USB hub particularly small for this purpose (down to
20mmx36mm), on which you can directly solder a USB cable instead of using a USB plug. For more
details, see the micro-USB hub information sheet.
2. Presentation
www.yoctopuce.com 5

YoctoHub-Ethernet, YoctoHub-Wireless and YoctoHub-GSM
You can add network connectivity to your Yocto-Display, thanks to the YoctoHub-Ethernet, the
YoctoHub-Wireless and the YoctoHub-GSM which provides repectiveley Ethernet, WiFi and GSM
connectivity. All of them can drive up to three devices and behave exactly like a regular computer
running a VirtualHub.
1.27mm (or 1.25mm) connectors
In case you wish to connect your Yocto-Display to a Micro-hub USB or a YoctoHub without using a
bulky USB connector, you can use the four 1.27mm pads just behind the USB connector. There are
two options.
You can mount the Yocto-Display directly on the hub using screw and spacers, and connect it using
1.27mm board-to-board connectors. To prevent shortcuts, it is best to solder the female connector on
the hub and the male connector on the Yocto-Display.
You can also use a small 4-wires cable with a 1.27mm connector. 1.25mm works as well, it does not
make a difference for 4 pins. This makes it possible to move the device a few inches away. Don't put
it too far away if you use that type of cable, because as the cable is not shielded, it may cause
undesirable electromagnetic emissions.
Enclosure
Your Yocto-Display has been designed to be installed as is in your project. Nevertheless, Yoctopuce
sells enclosures specifically designed for Yoctopuce modules. The recommended enclosure for your
Yocto-Display is the YoctoBox-Display model. It has a small removable stand enabling it to stay
upright, it is also equipped with powerful magnets allowing it to stick on ferromagnetic surfaces. More
details are available on the Yoctopuce web site 3.
You can install your Yocto-Display in an optional enclosure.
3 http://www.yoctopuce.com/EN/products/category/enclosures
2. Presentation
6 www.yoctopuce.com

3. Working principles
3.1. Embedded processor and memory
Like all the Yoctopuce modules, your Yocto-Display contains an embedded processor allowing it to
perform relatively complex operations transparently. Thus, to draw a line, the host computer only
needs to send a draw a line command to the Yocto-Display. It does not have to do anything else,
everything is managed by the Yocto-Display processor. For this reason, the Yocto-Display behaves a
little like a graphic accelerator where the graphical tasks are performed by a dedicated processor,
letting the main processor perform other tasks.
Your Yocto-Display contains also a small file system to help you store some graphics, fonts, and
other animations.
3.2. Orientation
To facilitate its hardware installation, your Yocto-Display can work in four distinct orientations. You
only need to set a single parameter. When you set the value of this parameter to left, up, right, or
down to indicate the position of the USB socket with regards to the circuit, the screen rotates its
content in order for it to appear in the correct orientation.
Parameter values LEFT, UP, RIGHT, and DOWN influence the orientation of the display.
This parameter is persistent and can be saved in the flash memory of the Yocto-Display.
3.3. Layer system
Your Yocto-Display works according to a principle of superposed and independent layers. You can
write and draw independently in each of the 5 layers. This allows you to simplify and optimize your
display code.
www.yoctopuce.com 7

Several display layers are available.
You can hide or show any layer. You can even laterally move these layers which are slightly larger
than the displayable surface (128x128), generating thus a scrolling effect. You can take advantage of
this layer system to implement a double buffering1system.
Each layer has its own graphical context: cursor position, current font, current color, etc... This
means that you must set these parameters for each layer with which you work. But this also means
that several distinct processes can interact with your Yocto-Display without risking conflict issues:
they only need to write in different layers.
Primitives working directly on display layers include:
•clear
•hide
•unhide
•setLayerPosition
•reset
•swapLayerContent
•copyLayerContent
3.4. Graphic routines
Your Yocto-Display contains basic graphic routines: lines, rectangles, circles, discs, text display, etc.
All these routines support clipping: you can write on top of a layer border, the part located in the zone
managed is taken into account, the outside part is ignored.
For more complex graphical operations, or simply if you feel more comfortable with it, you can also
use your favorite graphic library running on the host driving the Yocto-Display to build a bitmap in
memory, then render it with a single command on the layer of your choice. The Yoctopuce API is fast
enough to make this possible even to make real-time animations.
Basic graphic primitives are:
•moveTo
•lineTo
•drawPixel
•drawRect
•drawBar
•drawCircle
•drawDisc
•drawBitmap
•drawImage
Colors
The Yocto-Display screen is purely monochrome. You cannot, therefore, display grey levels, nor
benefit from anti-aliasing. You can draw using three "colors": the screen display color (which we will
1 http://en.wikipedia.org/wiki/Multiple_buffering
3. Working principles
8 www.yoctopuce.com

call "white" in this documentation even if it might be light blue for example), black, or transparent
(eraser).When you write using the transparent color, the layer below becomes visible. Note that layer
0 is not transparent. Writing in transparent color on this layer is equivalent to writing in black. This is
important when you switch the content of two layers.
Primitives allowing you to change the color of a drawing are:
•selectGrayPen
•selectEraser
3.5. Text display
You can display any text at an arbitrary location of the screen. The Yocto-Display contains some
embedded fonts, but you can create your own relatively easily. It is not possible to know beforehand
the size of a text, but to compensate this, numerous text alignment modes are available. You can
align text left, right, and center, from the decimal point, the base line, etc.
The alignment options
Primitives allowing you to display text are:
•selectFont
•drawText
Fonts built-in into the device firmware are:
•Small.yfm (height: 8 pixels)
•Medium.yfm (height: 16 pixels)
•Large.yfm (height: 32 pixels)
•8x8.yfm (monospaced)
Console mode
There is another method to display text on your Yocto-Display: the console mode. The console is a
rectangular area of which you can parameterize the position. Texts displayed in this console are
displayed like in a terminal, and line feeds are automatically generated. By default, the console size
of each layer is initialized to the size of the screen.
Primitives allowing you to manage the console are:
•clearConsole
•consoleOut
•setConsoleMargins
•setConsoleBackground
•setConsoleWordWrap
Internationalization and regional characters
The text display functions can render international characters for languages that meet the following
criteria:
•8-bit character set
3. Working principles
www.yoctopuce.com 9

•left-to-right writing
For character sets requiring more than 8-bit (for instance chinese characters) and for right-to-left
(RTL) languages, the only solution is to create a bitmap image on the computer using system built-in
functions, and to display it using the drawBitmap primitive.
For all other languages, you should simply make sure that you use using the same locale (or code
page) for the display font and for the text strings to draw. With this, you will be able to display all kind
of accented characters and glyphs. Built-in fonts are provided according to the iso-8859-1 locale
(also known as iso-latin-1 or Windows-1252), and support all languages from Western
Europe. But you can easily generate equivalent fonts for the locale used by your computer using the
small utility provided in the Delphi Library, under Examples\Display-font-generator.
In practice, for all languages with native Unicode support (e.g. 16-bit or UTF-8) like Python, C#, VB
or Java, you can configure in the API the codepage to use to convert from unicode character strings
to 8-bit format. The default value is iso-8859-1, corresponding to the built-in fonts.
For other languages like Delphi, C++ or PHP where the codepage is implicitly determined by the
encoding of the source file, and where conversions are under the responsibility of the developer, you
must simply take care to provide to the API a string that is compatible with the character set used in
your display. The most common pitfall is to use an UTF-8 encoded string (because this is the most
common format used by editors nowadays) and to forget to convert it into iso-8859-*before
using it with drawText or consoleOut. If your display shows two strange letters instead of every
accented character, this is the reason.
3.6. Font file format
Your Yocto-Display contains a few embedded fonts, but it is designed so that you could create your
own fonts as easily as possible. A font file for your Yocto-Display is mostly a large bitmap where all
the characters are drawn one after the other, in the order of the ASCII code of each character.
Besides the bitmap, these files include a header with a some more information, as well as a list of the
position of the last column of each character. The format is the following:
offset type Size (bytes) signification
0x00 U16 2Signature ("YF" 0x4659, little endian )
0x02 U8 1Version = 1
0x03 U8 1Bits by pixel =1
0x04 U16 2Wwidth of the bitmap, little endian,
(must be a multiple of 16)
0x06 U8 1Hheight of the bitmap
0x07 U8 1First defined character
0x08 U8 1Last defined character
0x09 U8 1Base line (starting from the bottom)
0x0A U16[] 2*NCoordinates of the last column
of each character (little endian)
0x0A +2*N U8[] H* W/ 16 Bitmap data
Practical example
Let us imagine that we wish to define a lower case 3x5 pixel font for numbers 0 to 9. The bitmap
would be the following:
3. Working principles
10 www.yoctopuce.com

Font bitmap example
The font file contains the following data:
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
00000000 59 46 01 01 30 00 06 01 30 39 03 00 05 00 09 00
00000010 0D 00 11 00 15 00 19 00 1D 00 21 00 25 00 EB BA
00000020 3B BB B8 00 A8 8A 22 0A A8 00 AB BA BB 8B B8 00
00000030 AA 0B 8A 8A 88 00 EB B8 BB 8B B8 00 00 00 00 00
00000040 00 00
Note that the bitmap width must be a multiple of 16 pixels and that the height cannot be above 255
pixels. Moreover, blank spaces between two characters are encoded directly in the image. You do
not have to leave a blank space below the characters if you do not intend to use your font in console
mode.
You can find in the Delphi library a small Windows tool2enabling you to generate font files from the
system fonts.
3.7. Sequences and animations
You can pre-program animations and play them as background tasks. To do so, you must call the
newSequence method of the Display object, then call the available graphical methods. You can
insert waiting times with pauseSequence. When you are done recording the sequence components,
call saveSequence. The sequence is then saved in the Yocto-Display file system. You can play it
back at will with playSequence. You can create loops by calling playSequence within a sequence.
You can find in the libraries a code sample3illustrating how sequences work. As soon as this
example is run, the screen starts playing the sequence indefinitely.
Be aware that sequences change the values of the layer parameters (current point, current color,
etc.) with which they work. If you use a sequence as an animation in background task, make sure to
work with a different layer than the one used by your sequence.
Startup sequence
When your Yocto-Display is powered on, it runs the yocto.seq sequence which is hard-coded inside
the module. But you can configure your module so that it runs a sequence that you have chosen.
3.8. Optimizations
While the Yocto-Display has its own processor and offers numerous graphical routines, it stays a
relatively slow system compared to a classic display system. This slowness is the result of using the
HID protocol so that the Yocto-Display can be driven without drivers. The transfer rate between the
screen and the computer is limited to 64Ko per second. Each request takes up about 3ms. However,
there are techniques to optimize display.
2 Examples\Display-font-generator
3 Prog-Display-Sequences
3. Working principles
www.yoctopuce.com 11

Writing in hidden layers
Actions to be performed on visible layers are immediately sent to the screen in order to be executed
as soon as possible. On the other hand, actions to be performed on hidden layers are buffered, in
order to send several commands at once. It is therefore much more efficient to write in a hidden layer
and to make it visible afterwards, which makes double buffering a very interesting technique.
Double buffering
The technique called double buffering enables you to display animations without making visible
artifacts linked to the creation of the graphics. It consists in working on two layers, one visible, the
other one hidden. The images are created in the hidden layer, and once the image is complete, the
two layers are switched. In the libraries, you can find an example4using this technique to animate a
Von Koch flake.
Using a bitmap
When the graphics become complex, it becomes more efficient to compute a bitmap on the host
computer and to send it to the screen. Use the drawBitmap to do this. Bitmap data are encoded in a
byte array, line by line, starting from the top left corner. In each byte, the most significant bit
represents the leftmost pixel. In the libraries, you can find an example5computing a Mandelbrot set
based on this principle.
Here is the C code allowing you to draw a pixel at the (x,y) coordinates in the byte array representing
a wx hbitmap.
void putpixel(unsigned char *data, int x, int y)
{
int bytesPerLine = (w + 7) >> 3;
data[ (x >> 3) + (y * bytesPerLine) ] |= 128 >> (x & 7);
}
4 Prog-Display-DoubleBuffering
5 Prog-Display-DrawBitmap
3. Working principles
12 www.yoctopuce.com

4. The embedded file system
Your Yocto-Display contains a small embedded file system, allowing it to store personalized files for
its own use. You can manipulate the file system thanks to the yocto_files library.
4.1. Usage
Interactive usage with the VirtualHub
The VirtualHub provides a succinct interface to manipulate the content of the file system: simply click
the configuration button corresponding to your module in the VirtualHub interface, then the manage
files button. The files are listed and you can view them, erase them, or add new ones (downloads).
Because of its small size, the file system does not have an explicit concept of directories. You can
nevertheless use the slash sign "/" inside file names to sort them as if they were in directories.
Programmed usage
Use the yocto_files library to manage the file system. Basic functions are available:
•upload creates a new file on the module, with a content that you provide;
•get_list lists the files on the module, including their content size and CRC32;
•download retrieves in a variable the content of a file present on the module;
•remove erases a file from the module;
•format resets the file system to an empty, not fragmented state.
A piece of software using a well designed file system should always start by making sure that all the
files necessary for its working are available on the module, and if needed upload them on the
module. We can thus transparently manage software updates and application deployment on new
modules. To make file versions easier to detect, the get_list method returns for each file a 32 bit
signature called CRC (Cyclic Redundancy Check) which identifies in a reliable manner the file
content. Thus, if the file CRC corresponds, there is less than one chance over 4 billions that the
content is not the correct one. You can even compute in advance in your software the CRC of the
content you want, and therefore check it without having to download the files. The CRC function used
by the Yoctopuce file system is the same as Ethernet, Gzip, PNG, etc. Its characteristic value for the
nine character string "123456789" is 0xCBF43926.
HTTP usage
You can access the files that your have downloaded on your Yocto-Display by HTTP, at the root of
the module (at the same level as the REST API). This allows you to load personalized HTML and
www.yoctopuce.com 13

Javascript interface pages, for example. You cannot, however, replace the content of a file preloaded
on the module, you can only add new ones.
4.2. Limitations
The file system embedded on your Yocto-Display has some technical limitations:
•Its maximal storage space is 3.5MB, allocated in blocks enabling to store up to about 128 files.
•Erasing a file does not necessarily immediately free all the space used by the file. The non
freed space is completely reused if you create a new file with the same name, but not
necessarily if you create files with a distinct name each time. For this reason, it is not
recommended to automatically create files with ever changing names.
•You can recover the whole non freed space with the format command which frees all the files.
•Each firmware update implicitly provokes a complete reformatting of the file system.
•As all flash memories, the memory used to store the files has a life of about 100'000 erasing
cycles. It is enough, but it is not infinite. Make sure that you do not write and erase files
uselessly and very quickly in a loop, or you may destroy your module.
4. The embedded file system
14 www.yoctopuce.com
Table of contents
Popular Control Unit manuals by other brands

Eaton
Eaton Crouse-hinds series instruction manual

Lenze
Lenze POWERLINK CN E94AYCEC Communications manual

Fantech
Fantech VT20M Installation

IFM Electronic
IFM Electronic Ecomot 100 CR2511 Device manual

System Sensor
System Sensor RR2 Installation and maintenance instructions

Duplomatic
Duplomatic DDC4-15-400/20 installation manual

Texas Instruments
Texas Instruments LMX2595EVM user guide

Emerson
Emerson Baumann 25000 Lo-T Series instructions

Stafsjö
Stafsjö BV Original Installation and service instruction

Siemens
Siemens SIRIUS 3RK3 Original operating instructions

Siemens
Siemens Simatic TI405 user manual

Emerson
Emerson numatics E22 Operation manual