This commit is contained in:
赵鑫 2022-09-01 13:56:33 +08:00
parent 93ec9c129f
commit f545b53ad5

View File

@ -57,6 +57,13 @@ function read_led(x, y) {
}
function read_all_leds() {
const a = sense.getPixels()
console.log(a[63])
const pixels = sense.getPixels()
for (let y = 0; y < 8; y++) {
for (let x = 0; x < 8; x++) {
const element = array[x]
leds[y][x] = sense.getPixel(x, y) == [0, 0, 0] ? 0 : 1
}
}
console.log(leds)
io.emit('leds', { leds })
}