This commit is contained in:
赵鑫 2022-09-05 12:03:51 +08:00
parent 7b86cf88b2
commit 4885029570

View File

@ -63,15 +63,15 @@ io.on('connection', (client) => {
case 'clear':
if (color == undefined) color = [0, 0, 0]
sensehat.led.clear(color)
io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
io.emit('action', { action: 'clear', color })
break
case 'flash':
if (color == undefined) color = [255, 255, 255]
sensehat.led.clear(color)
io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
io.emit('action', { action: 'clear', color })
setTimeout(() => {
sensehat.led.clear()
io.emit('action', { action: 'setPixels', pixels: sensehat.led.pixels })
io.emit('action', { action: 'clear' })
}, delay | 200)
break
// case 'getPixel':