update
This commit is contained in:
parent
fce603b392
commit
5466b7db70
@ -142,10 +142,9 @@
|
|||||||
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 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 }
|
const action = { action: 'setPixel', x, y, color }
|
||||||
console.log(action)
|
client.emit('action', action)
|
||||||
client.emit('operation', action)
|
|
||||||
}
|
}
|
||||||
// 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