![Yoctopuce Yocto-GPS User Manual Download Page 94](http://html1.mh-extra.com/html/yoctopuce/yocto-gps/yocto-gps_user-manual_3415557094.webp)
Procedure
Usage
()
;
var
exe :
string
;
begin
exe:=
ExtractFileName
(
paramstr
(
0
))
;
WriteLn
(
exe+
' <serial_number>'
)
;
WriteLn
(
exe+
' <logical_name>'
)
;
WriteLn
(
exe+
' any'
)
;
halt
;
End
;
var
gps : TYGps;
errmsg :
string
;
done :
boolean
;
begin
if
(
paramcount<
1
)
then
usage
()
;
// Setup the API to use local USB devices
if
yRegisterHub
(
'usb'
, errmsg
)
<>YAPI_SUCCESS
then
begin
Write
(
'RegisterHub error: '
+errmsg
)
;
exit
;
end
;
if
paramstr
(
1
)
=
'any'
then
begin
// try to find the first temperature gps available
gps := yFirstGps
()
;
if
gps=
nil
then
begin
writeln
(
'No module connected (check USB cable)'
)
;
halt
;
end
end
else
// or use the one specified on the commande line
gps:= YFindGps
(
paramstr
(
1
)
+
'.temperature'
)
;
// let's poll
done :=
false
;
repeat
if
(
gps.
isOnline
())
then
begin
if
(
gps.
get_isFixed
()
<>Y_ISFIXED_TRUE
)
then
Writeln
(
'fixing'
)
else
writeln
(
gps.
get_latitude
()
+
' '
+gps.
get_longitude
())
;
Writeln
(
' (press Ctrl-C to exit)'
)
;
Sleep
(
1000
)
;
end
else
begin
Writeln
(
'Module not connected (check identification and USB cable)'
)
;
done :=
true
;
end
;
until
done;
yFreeAPI
()
;
end
.
There are only a few really important lines in this sample example. We will look at them in details.
yocto_api and yocto_latitude
These two units provide access to the functions allowing you to manage Yoctopuce modules.
yocto_api
must always be used,
yocto_latitude
is necessary to manage modules containing
a latitude sensor, such as Yocto-GPS.
13. Using Yocto-GPS with Delphi
88
www.yoctopuce.com
Summary of Contents for Yocto-GPS
Page 1: ...Yocto GPS User s guide...
Page 2: ......
Page 6: ...22 Characteristics 557 Blueprint 559 Index 561...
Page 10: ...4 www yoctopuce com...
Page 14: ...8 www yoctopuce com...
Page 18: ...12 www yoctopuce com...
Page 22: ...16 www yoctopuce com...
Page 38: ...32 www yoctopuce com...
Page 42: ...36 www yoctopuce com...
Page 54: ...48 www yoctopuce com...
Page 72: ...66 www yoctopuce com...
Page 92: ...86 www yoctopuce com...
Page 122: ...116 www yoctopuce com...
Page 132: ...126 www yoctopuce com...
Page 564: ...22 Characteristics 558 www yoctopuce com...
Page 565: ......
Page 566: ......