diff --git a/index.html b/index.html index 83d1509..7573498 100644 --- a/index.html +++ b/index.html @@ -110,7 +110,8 @@ ,Arduino based robots use the library PestoLink-Receive.

Browser Support -
PestoLink works with Google Chrome on Windows, Android, iOS, MacOS, Linux, and ChromeOS. +
PestoLink works with Google Chrome on Windows, Android, Mac, Linux, and ChromeOS. +
On iOS very few web browsers support webBluetooth. Google Chrome has worked for some people, but Bluefy is the best option found so far.

What does "Override axes with WASD" do?
By default, keyboard data is sent seperatly from axis/button data. If you would like to drive your robot using your keyboard, diff --git a/index.js b/index.js index 8c4e458..dc34395 100644 --- a/index.js +++ b/index.js @@ -132,10 +132,10 @@ function renderLoop() { if (localStorage.getItem(toggleKeyboardWASD.id) === 'true') { for (let key of keyboardArray) { - if (key === 27 || key === 41) rawPacket[1] = clampUint8(rawPacket[1] - 128); - if (key === 29 || key === 37) rawPacket[1] = clampUint8(rawPacket[1] + 128); - if (key === 19 || key === 28) rawPacket[2] = clampUint8(rawPacket[2] - 128); - if (key === 22 || key === 30) rawPacket[2] = clampUint8(rawPacket[2] + 128); + if (key === 19 || key === 28) rawPacket[1] = clampUint8(rawPacket[2] - 128); + if (key === 22 || key === 30) rawPacket[1] = clampUint8(rawPacket[2] + 128); + if (key === 27 || key === 41) rawPacket[2] = clampUint8(rawPacket[1] - 128); + if (key === 29 || key === 37) rawPacket[2] = clampUint8(rawPacket[1] + 128); if (key === 44 || key === 20) rawPacket[5] |= (1 << 0) if (key === 42 || key === 32) rawPacket[5] |= (1 << 1) if (key === 21 || key === 31) rawPacket[5] |= (1 << 2)