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