update
This commit is contained in:
parent
1197a942f5
commit
dd20ee101a
@ -145,6 +145,13 @@
|
|||||||
const action = led.classList.toggle('on') ? 'on' : 'off'
|
const action = led.classList.toggle('on') ? 'on' : 'off'
|
||||||
client.emit('action', { action, x, y })
|
client.emit('action', { action, x, y })
|
||||||
}
|
}
|
||||||
|
client.on('leds', (array) => {
|
||||||
|
const leds = document.querySelectorAll('.led')
|
||||||
|
for (let i = 0; i < 64; i++) {
|
||||||
|
if (array[i] == 1) led.classList.add('on')
|
||||||
|
else led.classList.remove('on')
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user