From 5466b7db7078f3fb3c73265cb2af8a68c2448893 Mon Sep 17 00:00:00 2001 From: Zhao Xin <7176466@qq.com> Date: Mon, 5 Sep 2022 10:44:24 +0800 Subject: [PATCH] update --- sensehat/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sensehat/index.html b/sensehat/index.html index 0d74eb0..c7b6c64 100644 --- a/sensehat/index.html +++ b/sensehat/index.html @@ -142,10 +142,9 @@ const client = io.connect('ws://pi', { path: '/sensehat/socket.io', }) function turnon(led) { const { x, y } = led.dataset - const color = led.classList.toggle('on') ? [0, 0, 0] : [255, 255, 255] + const color = led.classList.toggle('on') ? [255, 255, 255] : [0, 0, 0] const action = { action: 'setPixel', x, y, color } - console.log(action) - client.emit('operation', action) + client.emit('action', action) } // client.on('leds', (array) => { // const leds = document.querySelectorAll('.led')