From efdaea5d1e8af1845e9b2f08f992da37b31d4e1e Mon Sep 17 00:00:00 2001 From: finchiedev Date: Thu, 4 Jul 2019 13:20:04 +0800 Subject: [PATCH] Fix camera reset --- App/JS/client.js | 20 ++++++++++++++++++-- App/JS/sensors.js | 2 +- App/index.html | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/App/JS/client.js b/App/JS/client.js index d38848f..a5c5e54 100755 --- a/App/JS/client.js +++ b/App/JS/client.js @@ -346,8 +346,10 @@ async function writeDefaultValues() { grabberValue = 0; moveGrabber(1); - clientSocket.send('20,100', 25565, '192.168.100.1') - lastCameraVals = [20, 100] + setTimeout(function() { + clientSocket.send('10,100', 25565, '192.168.100.1') + lastCameraVals = [10, 100] + }, 100) } /** @@ -378,6 +380,20 @@ async function pollGamepad(gamepad, sticks = false) { drawFlipperLines(context); } +function moveStraight() { + clientSocket.send('01300', 9999, '192.168.100.1') + clientSocket.send('03300', 9999, '192.168.100.1') + clientSocket.send('02-300', 9999, '192.168.100.1') + clientSocket.send('04-300', 9999, '192.168.100.1') +} + +function stop() { + clientSocket.send('010', 9999, '192.168.100.1') + clientSocket.send('030', 9999, '192.168.100.1') + clientSocket.send('020', 9999, '192.168.100.1') + clientSocket.send('040', 9999, '192.168.100.1') +} + // client.connect(5000, '192.168.100.1', function() { // console.log("Connected to server interface"); // }) diff --git a/App/JS/sensors.js b/App/JS/sensors.js index 556ea3d..c1920cd 100644 --- a/App/JS/sensors.js +++ b/App/JS/sensors.js @@ -29,7 +29,7 @@ server.on('message', function(message, remote) { } var value = parseInt(build) if (index == "carbon_dioxide") { - value = -1 * (value - 1023) + // value = -1 * (value - 1023) } sensors[index].currentValue = value // document.getElementById(index).innerHTML = `${build} PPM` diff --git a/App/index.html b/App/index.html index af03df0..4313f66 100755 --- a/App/index.html +++ b/App/index.html @@ -12,6 +12,8 @@

Dashboard - Robotics GUI

+ +

Grabber Direction

Grabber position: 0%