From f0f865d2e75d02a7048a4a53e5de47bc61b2a788 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 17 Nov 2023 12:37:12 -0500 Subject: [PATCH] MOAR LOGS --- main.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index 1fe96d8..9d5a09d 100644 --- a/main.js +++ b/main.js @@ -57,26 +57,38 @@ function main(gpio) { if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: IGN: [${config.status.igniter}] | EXH: [${config.status.exhaust}] | AUG: [${config.status.auger}]`); switch (config.status.igniter) { case 0: - fn.igniter.off(gpio); + fn.igniter.off(gpio).then(res => { + if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`); + }); break; case 1: - fn.igniter.on(gpio); + fn.igniter.on(gpio).then(res => { + if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`); + }); break; default: - fn.igniter.off(gpio); + fn.igniter.off(gpio).then(res => { + if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`); + }); break; } // Set the Exhaust switch (config.status.exhaust) { case 0: - fn.exhaust.off(gpio); + fn.exhaust.off(gpio).then(res => { + if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`); + }); break; case 1: - fn.exhaust.on(gpio); + fn.exhaust.on(gpio).then(res => { + if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`); + }); break; default: - fn.exhaust.off(gpio); + fn.exhaust.off(gpio).then(res => { + if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`); + }); break; }