This commit is contained in:
GZod01 2023-04-08 11:46:54 +02:00
parent a4b322b865
commit d0fb89d7db

View file

@ -123,9 +123,20 @@
} }
if (newGpDictState.buttons.x.pressed) { if (newGpDictState.buttons.x.pressed) {
// one time action // one time action
console.log("Stop robot action"); console.log("stop robot action");
currentWs.send("stop_robot", {}); currentWs.send("stop_robot", {});
} }
if (hasGpChange(['buttons.triangle'])) {
if(newGpDictState.buttons.triangle.pressed){
// one time action
console.log("turbine action");
currentWs.send("set_turbine", {"speed":20});
}
else{
console.log("stop_turbine")
currentWs.send("set_turbine",{"speed":0})
}
}
if (hasGpChange(['axes.left_joystick_x', 'axes.left_joystick_y'])) { if (hasGpChange(['axes.left_joystick_x', 'axes.left_joystick_y'])) {
leftJoystick.onGamepadJoystickChange( leftJoystick.onGamepadJoystickChange(