aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stendahl <jakobste@uio.no>2021-01-12 16:07:57 +0100
committerJakob Stendahl <jakobste@uio.no>2021-01-12 16:07:57 +0100
commit8ade112da0a06c1c114e11746551c76a2c146dc0 (patch)
tree3d0aceb90f766a4317b8f23e03b11c302caedd4c
parent23c95e883760db30b98d0b65a65a85cc5eb3597d (diff)
downloadhoverbit-ble-8ade112da0a06c1c114e11746551c76a2c146dc0.tar.gz
hoverbit-ble-8ade112da0a06c1c114e11746551c76a2c146dc0.zip
:bug: Fix bluetooth send method
-rw-r--r--script.js7
-rw-r--r--styles.css7
2 files changed, 10 insertions, 4 deletions
diff --git a/script.js b/script.js
index 85b5d61..9060db6 100644
--- a/script.js
+++ b/script.js
@@ -231,9 +231,10 @@ document.getElementById("btn_connect").onclick = async () => {
if (device) {
if (device.gatt.connected) {
let command =
- "T" + hoverControl.getThrottle() +
- "R" + hoverControl.getRudder() +
+ "T" + hoverControl.getThrottle().toString() +
+ "R" + hoverControl.getRudder().toString() +
"A" + (hoverControl.getArm() ? "1" : "0") +
+ "S0" +
":";
await services.uartService.sendText(command);
} else {
@@ -241,7 +242,7 @@ document.getElementById("btn_connect").onclick = async () => {
device.gatt.disconnect();
}
}
- }, 50);
+ }, 70);
}
}
diff --git a/styles.css b/styles.css
index dd18832..115a533 100644
--- a/styles.css
+++ b/styles.css
@@ -101,7 +101,8 @@ body {
margin-top: 5px;
border: 1px solid black;
background-color: #b5b5b5;
- padding: 5px;
+ padding: 10px;
+ width: 120px;
}
.throttle {
@@ -136,6 +137,10 @@ body {
border: 1px solid black;
}
+.rudder-labels {
+ position: absolute;
+}
+
.rudder-thumb {
position: absolute;
bottom: 0;