14. Using Yocto-RangeFinder with Delphi
Delphi is a descendent of Turbo-Pascal. Originally, Delphi was produced by Borland, Embarcadero
now edits it. The strength of this language resides in its ease of use, as anyone with some notions of
the Pascal language can develop a Windows application in next to no time. Its only disadvantage is
to cost something
1
.
Delphi libraries are provided not as VCL components, but directly as source files. These files are
compatible with most Delphi versions.
2
To keep them simple, all the examples provided in this documentation are console applications.
Obviously, the libraries work in a strictly identical way with VCL applications.
You will soon notice that the Delphi API defines many functions which return objects. You do not
need to deallocate these objects yourself, the API does it automatically at the end of the application.
14.1. Preparation
Go to the Yoctopuce web site and download the Yoctopuce Delphi libraries
3
. Uncompress everything
in a directory of your choice, add the subdirectory
sources
in the list of directories of Delphi libraries.
4
By default, the Yoctopuce Delphi library uses the
yapi.dll
DLL, all the applications you will create with
Delphi must have access to this DLL. The simplest way to ensure this is to make sure
yapi.dll
is
located in the same directory as the executable file of your application.
14.2. Control of the RangeFinder function
Launch your Delphi environment, copy the yapi.dll DLL in a directory, create a new console
application in the same directory, and copy-paste the piece of code below:
program
helloworld;
{$APPTYPE CONSOLE}
uses
SysUtils,
Windows,
yocto_api,
yocto_rangeFinder,
1
Actually, Borland provided free versions (for personal use) of Delphi 2006 and 2007. Look for them on the Internet, you
may still be able to download them.
2
Delphi libraries are regularly tested with Delphi 5 and Delphi XE2.
3
www.yoctopuce.com/EN/libraries.php
4
Use the
Tools / Environment options
menu.
www.yoctopuce.com
85
Содержание 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: ......