diff --git a/server.js b/server.js index cd6f5c2..4e2a5b2 100644 --- a/server.js +++ b/server.js @@ -105,13 +105,13 @@ io.on('connection', (client) => { io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels }) break case 'turnLeft': - var r = ((Number(sensehat.led.rotation) - 90) + 360) % 360 + var r = (Number(sensehat.led.rotation) + 90) % 360 sensehat.led.rotation = r sensehat.led.setRotation() // io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels }) break case 'turnRight': - var r = (Number(sensehat.led.rotation) + 90) % 360 + var r = (Number(sensehat.led.rotation) + 360 - 90) % 360 sensehat.led.rotation = r sensehat.led.setRotation(r) // io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })