Page MenuHomec4science

dpt
No OneTemporary

File Metadata

Created
Wed, Jan 8, 15:53
#!/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