update
This commit is contained in:
parent
93ec9c129f
commit
f545b53ad5
11
sensehat.js
11
sensehat.js
@ -57,6 +57,13 @@ function read_led(x, y) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function read_all_leds() {
|
function read_all_leds() {
|
||||||
const a = sense.getPixels()
|
const pixels = sense.getPixels()
|
||||||
console.log(a[63])
|
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 })
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user