MOAR LOGS

This commit is contained in:
Skylar Grant 2023-11-17 12:37:12 -05:00
parent eea8c9fef5
commit f0f865d2e7

24
main.js
View File

@ -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;
}