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