extract speed value
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import socket
|
||||
import struct
|
||||
import math
|
||||
import time
|
||||
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
sock.bind(("127.0.0.1", 1337))
|
||||
|
||||
while True:
|
||||
data, addr = sock.recvfrom(1024)
|
||||
caca = struct.unpack('<iI27f4i20f5i' + 'i19fH6B4b', data)
|
||||
# for value in caca:
|
||||
# v = math.floor(value)
|
||||
# print(f"{v:08}\t", end='')
|
||||
# print()
|
||||
print(round(time.time(), 2), round(caca[10]*3.6, 3))
|
||||
# print("received message: %s" % caca[244])
|
||||
Reference in New Issue
Block a user