This commit is contained in:
赵鑫 2022-09-05 14:30:02 +08:00
parent 4fcf068c51
commit 03a15cdb60

View File

@ -108,13 +108,13 @@ io.on('connection', (client) => {
var r = (Number(sensehat.led.rotation) + 90) % 360 var r = (Number(sensehat.led.rotation) + 90) % 360
sensehat.led.rotation = r sensehat.led.rotation = r
sensehat.led.setRotation(r) sensehat.led.setRotation(r)
// io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels }) io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
break break
case 'turnRight': case 'turnRight':
var r = (Number(sensehat.led.rotation) + 360 - 90) % 360 var r = (Number(sensehat.led.rotation) + 360 - 90) % 360
sensehat.led.rotation = r sensehat.led.rotation = r
sensehat.led.setRotation(r) sensehat.led.setRotation(r)
// io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels }) io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
break break
// case 'on': // case 'on':
// sense.setPixel(Number(x), Number(y), color_blue) // sense.setPixel(Number(x), Number(y), color_blue)