fix servo scaling

This commit is contained in:
2024-08-10 19:14:50 +02:00
parent b9f8e90dd7
commit 43b23ec1ad
6 changed files with 9 additions and 20 deletions

View File

@@ -90,8 +90,9 @@
}
function send(x,y,angle){
x = Math.round((x + 200) * 81.92);
y = Math.round((y + 200) * 81.92);
factor = (2**16-1)/400
x = Math.round((x + 200) * factor);
y = Math.round((y + 200) * factor);
var data = clientId + ";d;" + x.toString() + "," + y.toString();
connection.send(data);
}