From 505b2b07e664c9097b86dba4ba0c46d003dcda43 Mon Sep 17 00:00:00 2001 From: Zhao Xin <7176466@qq.com> Date: Thu, 1 Sep 2022 14:09:47 +0800 Subject: [PATCH] update --- public/index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index f7dacce..2c57fd0 100644 --- a/public/index.html +++ b/public/index.html @@ -147,9 +147,11 @@ } client.on('leds', (array) => { const leds = document.querySelectorAll('.led') - for (let i = 0; i < 64; i++) { - if (array[i] == 1) leds[i].classList.add('on') - else leds[i].classList.remove('on') + for (let y = 0; y < 8; y++) { + for (let x = 0; x < 8; x++) { + if (array[y][x] == 1) leds[i].classList.add('on') + else leds[i].classList.remove('on') + } } })