Compare commits
2 Commits
da06ebc49e
...
f861b1a145
Author | SHA1 | Date | |
---|---|---|---|
f861b1a145 | |||
e7ada41977 |
@ -1,6 +1,4 @@
|
||||
const { exec } = require('child_process');
|
||||
const { pins } = require('./config.json');
|
||||
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
module.exports = {
|
||||
// Calls the GPIO Interface script to toggle a pin's state opposite of its current state
|
||||
|
@ -9,6 +9,9 @@ module.exports = {
|
||||
console.log(message);
|
||||
}
|
||||
},
|
||||
sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
},
|
||||
gpio: {
|
||||
// Boot up sanity check during debug mode
|
||||
async debugInit() {
|
||||
@ -29,7 +32,7 @@ module.exports = {
|
||||
module.exports.log(`Toggled ${pin.key}`);
|
||||
});
|
||||
// Wait 1000ms before toggling again.
|
||||
await sleep(1000);
|
||||
await module.exports.sleep(1000);
|
||||
gpio.togglePin(pin.board, err => {
|
||||
if (err) throw err;
|
||||
module.exports.log(`Toggled ${pin.key}`);
|
||||
|
Loading…
Reference in New Issue
Block a user