import sys
import pyautogui as pag
import time
import serial
ArduinoSerial=serial.Serial('com3',9600)
time.sleep(1)
while 1:
data=str(ArduinoSerial.readline())
(x,y,z)=data.split(":")
(X,Y)=pag.position()
x=float(x)
y=float(y)
pag.moveTo(X+x,Y-y)
if '1' in z:
pag.click(button="left")
Traceback (most recent call last):
File "c:\Users\Admin\Desktop\Mouse_Joystick.py", line 13, in <module>
x=float(x)
^^^^^^^^
ValueError: could not convert string to float: "b'50"