update
This commit is contained in:
parent
ee09e01e66
commit
85cdc3abaf
@ -62,19 +62,22 @@ io.on('connection', (client) => {
|
|||||||
case 'clear':
|
case 'clear':
|
||||||
if (color == undefined) color = [0, 0, 0]
|
if (color == undefined) color = [0, 0, 0]
|
||||||
sensehat.led.clear(color)
|
sensehat.led.clear(color)
|
||||||
|
client.emit('action', { action: 'clear', color })
|
||||||
break
|
break
|
||||||
case 'flash':
|
case 'flash':
|
||||||
if (color == undefined) color = [255, 255, 255]
|
if (color == undefined) color = [255, 255, 255]
|
||||||
sensehat.led.clear(color)
|
sensehat.led.clear(color)
|
||||||
setTimeout(sensehat.led.clear, delay | 200)
|
setTimeout(sensehat.led.clear, delay | 200)
|
||||||
|
client.emit('action', { action: 'clear' })
|
||||||
break
|
break
|
||||||
case 'getPixel':
|
case 'getPixel':
|
||||||
color = sensehat.led.getPixel(x, y)
|
color = sensehat.led.getPixel(x, y)
|
||||||
client.emit('setPixel', { x, y, color })
|
client.emit('action', { action: 'setPixel', x, y, color })
|
||||||
break
|
break
|
||||||
case 'setPixel':
|
case 'setPixel':
|
||||||
if (color == undefined) color = [255, 255, 255]
|
if (color == undefined) color = [255, 255, 255]
|
||||||
sensehat.led.setPixel(x, y, color)
|
sensehat.led.setPixel(x, y, color)
|
||||||
|
io.emit('action', { action: 'setPixel', x, y, color })
|
||||||
break
|
break
|
||||||
// case 'on':
|
// case 'on':
|
||||||
// sense.setPixel(Number(x), Number(y), color_blue)
|
// sense.setPixel(Number(x), Number(y), color_blue)
|
||||||
|
Loading…
Reference in New Issue
Block a user