This commit is contained in:
赵鑫 2022-09-05 11:46:43 +08:00
parent efd83b456f
commit cc010c477c

View File

@ -63,7 +63,7 @@ io.on('connection', (client) => {
case 'clear':
if (color == undefined) color = [0, 0, 0]
sensehat.led.clear(color)
io.emit('action', { action: 'setPixels', pixels })
io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
break
// case 'flash':
// if (color == undefined) color = [255, 255, 255]
@ -81,8 +81,7 @@ io.on('connection', (client) => {
// io.emit('action', { action: 'setPixel', x, y, color })
// break
case 'getPixels':
const pixels = sensehat.led.setPixels()
io.emit('action', { action: 'setPixels', pixels })
io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
break
// case 'on':
// sense.setPixel(Number(x), Number(y), color_blue)