update
This commit is contained in:
parent
fce603b392
commit
5466b7db70
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user