![Yoctopuce Yocto-GPS Скачать руководство пользователя страница 81](http://html1.mh-extra.com/html/yoctopuce/yocto-gps/yocto-gps_user-manual_3415557081.webp)
Yocto-GPS configuration. To get a floating point value, no matter the configuartion, use the YLatitude
Class.
A real example
Launch Microsoft VisualBasic and open the corresponding sample project provided in the directory
Examples/Doc-GettingStarted-Yocto-GPS
of the Yoctopuce library.
In this example, you will recognize the functions explained above, but this time used with all side
materials needed to make it work nicely as a small demo.
Module
Module1
Private
Sub
Usage
()
Dim
execname =
System
.
AppDomain
.
CurrentDomain
.
FriendlyName
Console
.
WriteLine
(
"Usage:"
)
Console
.
WriteLine
(
ex
" <serial_number>"
)
Console
.
WriteLine
(
ex
" <logical_name>"
)
Console
.
WriteLine
(
ex
" any "
)
System.
Threading
.
Thread
.
Sleep
(
2500
)
End
End
Sub
Sub
Main
()
Dim
argv
()
As
String
=
System
.
Environment
.
GetCommandLineArgs
()
Dim
errmsg
As
String
=
""
Dim
target
As
String
Dim
gps
As
YGps
If
argv.
Length
<
2
Then
Usage
()
target = argv
(
1
)
REM Setup the API to use local USB devices
If
(
yRegisterHub
(
"usb"
, errmsg
)
<> YAPI_SUCCESS
)
Then
Console
.
WriteLine
(
"RegisterHub error: "
+ errmsg
)
End
End
If
If
target =
"any"
Then
gps = yFirstGps
()
If
gps
Is
Nothing
Then
Console
.
WriteLine
(
"No module connected (check USB cable) "
)
End
End
If
Else
gps = yFindGps
(
".gps"
)
End
If
While
(
True
)
If
Not
(
gps.
isOnline
())
Then
Console
.
WriteLine
(
"Module not connected (check identification and USB cable)"
)
End
End
If
If
(
gps.
get_isFixed
()
<> YGps.
ISFIXED_TRUE
)
Then
Console
.
WriteLine
(
"Fixing..."
)
Else
Console
.
WriteLine
(
gps.
get_latitude
()
+
" "
+ gps.
get_longitude
())
End
If
Console
.
WriteLine
(
" (press Ctrl-C to exit)"
)
ySleep
(
1000
, errmsg
)
End
While
yFreeAPI
()
End
Sub
End
Module
11.4. Control of the module part
Each module can be controlled in a similar manner, you can find below a simple sample program
displaying the main parameters of the module and enabling you to activate the localization beacon.
11. Using Yocto-GPS with Visual Basic .NET
www.yoctopuce.com
75
Содержание Yocto-GPS
Страница 1: ...Yocto GPS User s guide...
Страница 2: ......
Страница 6: ...22 Characteristics 557 Blueprint 559 Index 561...
Страница 10: ...4 www yoctopuce com...
Страница 14: ...8 www yoctopuce com...
Страница 18: ...12 www yoctopuce com...
Страница 22: ...16 www yoctopuce com...
Страница 38: ...32 www yoctopuce com...
Страница 42: ...36 www yoctopuce com...
Страница 54: ...48 www yoctopuce com...
Страница 72: ...66 www yoctopuce com...
Страница 92: ...86 www yoctopuce com...
Страница 122: ...116 www yoctopuce com...
Страница 132: ...126 www yoctopuce com...
Страница 159: ...20 High level API Reference On failure throws an exception or returns a negative error code www yoctopuce com 153...
Страница 564: ...22 Characteristics 558 www yoctopuce com...
Страница 565: ......
Страница 566: ......