Compare commits
2 Commits
c911da4dc0
...
ee4b4d2081
Author | SHA1 | Date | |
---|---|---|---|
ee4b4d2081 | |||
2bf2c86587 |
@ -27,7 +27,7 @@ read_all_leds()
|
|||||||
let zhao_server_errors = 0
|
let zhao_server_errors = 0
|
||||||
|
|
||||||
const job = new CronJob(
|
const job = new CronJob(
|
||||||
'*/5 * * * * *',
|
'*/1 * * * * *',
|
||||||
async () => {
|
async () => {
|
||||||
// 测试 http://zhao 的连通性
|
// 测试 http://zhao 的连通性
|
||||||
request('http://zhao', (err, res, body) => {
|
request('http://zhao', (err, res, body) => {
|
||||||
@ -42,8 +42,10 @@ const job = new CronJob(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let color = sense.getPixel(0, 0)
|
let color = sense.getPixel(0, 0)
|
||||||
color[2] = (color[2] + 50) % 255
|
let r = color[0]
|
||||||
sense.setPixel(0, 0, color)
|
let g = color[1]
|
||||||
|
let b = color[2]
|
||||||
|
sense.setPixel(0, 0, [r, g > 0 ? 0 : 255, b])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user