update
This commit is contained in:
parent
d7022be7b7
commit
b2ceb8d3bf
@ -55,14 +55,14 @@ io.on('connection', (client) => {
|
||||
client.on('action', ({ action, x, y, color, pixels, delay }) => {
|
||||
switch (action) {
|
||||
case 'clear':
|
||||
console.log('清除所有点')
|
||||
sensehat.led.clear()
|
||||
console.log('清除所有点')
|
||||
break
|
||||
case 'flash':
|
||||
console.log(action, x, y, color, pixels, delay)
|
||||
console.log('闪光', color | [255, 255, 255], delay | 200)
|
||||
sensehat.led.clear(color | [255, 255, 255])
|
||||
if (color == undefined) color = [255, 255, 255]
|
||||
sensehat.led.clear(color)
|
||||
setTimeout(sensehat.led.clear, delay | 200)
|
||||
console.log('闪光', color, delay | 200)
|
||||
break
|
||||
case 'setPixel':
|
||||
sensehat.led.setPixel(Number(x), Number(y), color)
|
||||
|
Loading…
Reference in New Issue
Block a user