This commit is contained in:
赵鑫 2022-09-05 10:53:55 +08:00
parent b0a912b6cf
commit e14b2e119e

View File

@ -55,9 +55,11 @@ io.on('connection', (client) => {
client.on('action', ({ action, x, y, color, pixels, delay }) => { client.on('action', ({ action, x, y, color, pixels, delay }) => {
switch (action) { switch (action) {
case 'clear': case 'clear':
console.log('清除所有点')
sensehat.led.clear() sensehat.led.clear()
break break
case 'flash': case 'flash':
console.log('闪光')
sensehat.led.clear(color | [255, 255, 255]) sensehat.led.clear(color | [255, 255, 255])
setTimeout(sensehat.led.clear, delay | 200) setTimeout(sensehat.led.clear, delay | 200)
break break