update
This commit is contained in:
parent
fbddc5fef7
commit
a59169aa7f
@ -142,8 +142,8 @@
|
||||
const client = io.connect('ws://pi', { path: '/sensehat/socket.io', })
|
||||
function turnon(led) {
|
||||
const { x, y } = led.dataset
|
||||
const action = led.classList.toggle('on') ? 'on' : 'off'
|
||||
client.emit('operation', { action, x, y })
|
||||
const color = led.classList.toggle('on') ? [0, 0, 0] : [255, 255, 255]
|
||||
client.emit('operation', { action: 'setPixel', x, y, color })
|
||||
}
|
||||
// client.on('leds', (array) => {
|
||||
// const leds = document.querySelectorAll('.led')
|
||||
|
Loading…
Reference in New Issue
Block a user