From 85cdc3abafa811bfdc77842a69cd06183848bd6b Mon Sep 17 00:00:00 2001 From: Zhao Xin <7176466@qq.com> Date: Mon, 5 Sep 2022 11:27:18 +0800 Subject: [PATCH] update --- server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index c53a9e3..3f7cd9a 100644 --- a/server.js +++ b/server.js @@ -62,19 +62,22 @@ io.on('connection', (client) => { case 'clear': if (color == undefined) color = [0, 0, 0] sensehat.led.clear(color) + client.emit('action', { action: 'clear', color }) break case 'flash': if (color == undefined) color = [255, 255, 255] sensehat.led.clear(color) setTimeout(sensehat.led.clear, delay | 200) + client.emit('action', { action: 'clear' }) break case 'getPixel': color = sensehat.led.getPixel(x, y) - client.emit('setPixel', { x, y, color }) + client.emit('action', { action: 'setPixel', x, y, color }) break case 'setPixel': if (color == undefined) color = [255, 255, 255] sensehat.led.setPixel(x, y, color) + io.emit('action', { action: 'setPixel', x, y, color }) break // case 'on': // sense.setPixel(Number(x), Number(y), color_blue)