Compare commits

..

2 Commits

Author SHA1 Message Date
f861b1a145 Another reference error 2024-08-18 14:39:07 -04:00
e7ada41977 Removing more vestigials 2024-08-18 14:37:59 -04:00
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,4 @@
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

View File

@ -9,6 +9,9 @@ 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() {
@ -29,7 +32,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 sleep(1000); await module.exports.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}`);