Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98013615
dpt
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jan 8, 15:53
Size
470 B
Mime Type
text/x-python
Expires
Fri, Jan 10, 15:53 (2 d)
Engine
blob
Format
Raw Data
Handle
23480729
Attached To
R890 mux0183
dpt
View Options
#!/usr/bin/env python3
import
time
,
random
,
sys
sys
.
path
.
append
(
'../lib'
)
from
nmeaSender
import
NmeaSender
from
nmea0183
import
DPT
# Create NmeaSender and DPT message handler
nS
=
NmeaSender
(
sys
.
argv
)
Dpt
=
DPT
(
DPT
.
nmeaAttributes
,
'XY'
)
offset
=
'0.7'
# Loop until Ctrl-C
while
True
:
depth
=
str
(
random
.
randint
(
5
,
10
))
message
=
Dpt
.
encodeList
([
depth
,
offset
])
nS
.
send
(
message
)
try
:
time
.
sleep
(
2
)
except
:
nS
.
terminate
()
# EOF
Event Timeline
Log In to Comment