bugs
This commit is contained in:
parent
e8578c39df
commit
3fb557dd4a
1 changed files with 1 additions and 1 deletions
2
main.py
2
main.py
|
@ -52,7 +52,7 @@ def main(device_path, dest_ip, dest_port):
|
||||||
# The format string 'HH' specifies two unsigned short integers (u16).
|
# The format string 'HH' specifies two unsigned short integers (u16).
|
||||||
# The '<' character ensures little-endian byte order.
|
# The '<' character ensures little-endian byte order.
|
||||||
try:
|
try:
|
||||||
packet = struct.pack('<HH', x_coor, y_coor)
|
packet = struct.pack('<HH', (float(x_coor)/32767.0)*1920, (float(y_coor)/32767.0)*1080)
|
||||||
|
|
||||||
# Send the packet over UDP
|
# Send the packet over UDP
|
||||||
sock.sendto(packet, (dest_ip, dest_port))
|
sock.sendto(packet, (dest_ip, dest_port))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue