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