Better logging

This commit is contained in:
Skylar Grant 2024-09-04 20:48:25 -04:00
parent 94af045e0c
commit 5c278e9dd5

View File

@ -64,18 +64,24 @@ module.exports = {
}).catch(e => console.error(e)); }).catch(e => console.error(e));
// Start the exhaust // Start the exhaust
this.exhaust().then(() => { this.exhaust().then((res) => {
module.exports.log(res);
// Check for vacuum // Check for vacuum
this.vacuum().then(() => { this.vacuum().then((res) => {
module.exports.log(res);
// Start the auger // Start the auger
this.auger().then(() => { this.auger().then((res) => {
module.exports.log(res);
resolve('Startup sequence complete.'); resolve('Startup sequence complete.');
}).catch(e => console.error(e)); }).catch(e => console.error(e));
// Preheat the igniter // Preheat the igniter
this.igniter().then(() => { this.igniter().then((res) => {
module.exports.sleep(config.power.start.igniterDelay).then(() => { module.exports.log(res);
module.exports.sleep(config.power.start.igniterDelay).then((res) => {
module.exports.log(res);
// Check for fire // Check for fire
this.fire().then(() => { this.fire().then((res) => {
module.exports.log(res);
}).catch(e => console.error(e)); }).catch(e => console.error(e));
}); });
}).catch(e => console.error(e)); }).catch(e => console.error(e));
@ -117,6 +123,14 @@ module.exports = {
}).catch(e => console.error(e)); }).catch(e => console.error(e));
}); });
}, },
auger() {
return new Promise(async (resolve, reject) => {
// Start auger
gpio.setPin(process.pinMap.get('auger').board, 1).then(() => {
resolve('Auger started.');
}).catch(e => console.error(e));
});
},
fire() { fire() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
// Check for fire // Check for fire