Dec-13-2020, 05:55 PM
(Dec-13-2020, 05:01 PM)bowlofred Wrote: Probably something like
ser.write(str(xcoord).encode())
Yes. Almost there.
I try with print first and worked.
I need both x and y
so I try
print(str(xcoord).encode(),str(ycoord).encode())And worked too.
Then I try
ser.write(str(xcoord).encode(),str(ycoord).encode())And I get
t.callbacks[evt.number](x,y,evt.edge) ser.write(str(xcoord),encode(),str(ycoord).encode()) TypeError: write() takes 2 positional arguments but 3 were given