This commit is contained in:
赵鑫 2022-09-05 14:23:10 +08:00
parent 6a6aaf2167
commit 47f2313347

View File

@ -105,11 +105,11 @@ io.on('connection', (client) => {
io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
break
case 'turnLeft':
sensehat.led.rotation = ((sensehat.led.rotation - 90) + 360) % 360
sensehat.led.setRotation(((sensehat.led.rotation - 90) + 360) % 360)
io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
break
case 'turnRight':
sensehat.led.rotation = (sensehat.led.rotation + 90) % 360
sensehat.led.setRotation((sensehat.led.rotation + 90) % 360)
io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
break
// case 'on':