update
This commit is contained in:
parent
6d9f8f36c2
commit
af6f38b2da
@ -52,11 +52,14 @@ sensehat.led.loadImage('images/heart.png')
|
||||
// socketio 服务
|
||||
const io = require('socket.io')(server, { cors: { origin: '*' } })
|
||||
io.on('connection', (client) => {
|
||||
client.on('operation', ({ action, x, y, color, r, g, b, pixels }) => {
|
||||
client.on('operation', ({ action, x, y, color, pixels }) => {
|
||||
switch (action) {
|
||||
case 'clear':
|
||||
sensehat.led.clear()
|
||||
break
|
||||
case 'setPixel':
|
||||
sensehat.led.setPixel(Number(x), Number(y), color)
|
||||
break
|
||||
// case 'on':
|
||||
// sense.setPixel(Number(x), Number(y), color_blue)
|
||||
// leds[y][x] = 1
|
||||
|
Loading…
Reference in New Issue
Block a user