Better logging

This commit is contained in:
Skylar Grant 2024-09-04 20:48:25 -04:00
parent 94af045e0c
commit 5c278e9dd5
1 changed files with 20 additions and 6 deletions

View File

@ -64,18 +64,24 @@ module.exports = {
}).catch(e => console.error(e));
// Start the exhaust
this.exhaust().then(() => {
this.exhaust().then((res) => {
module.exports.log(res);
// Check for vacuum
this.vacuum().then(() => {
this.vacuum().then((res) => {
module.exports.log(res);
// Start the auger
this.auger().then(() => {
this.auger().then((res) => {
module.exports.log(res);
resolve('Startup sequence complete.');
}).catch(e => console.error(e));
// Preheat the igniter
this.igniter().then(() => {
module.exports.sleep(config.power.start.igniterDelay).then(() => {
this.igniter().then((res) => {
module.exports.log(res);
module.exports.sleep(config.power.start.igniterDelay).then((res) => {
module.exports.log(res);
// Check for fire
this.fire().then(() => {
this.fire().then((res) => {
module.exports.log(res);
}).catch(e => console.error(e));
});
}).catch(e => console.error(e));
@ -117,6 +123,14 @@ module.exports = {
}).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() {
return new Promise(async (resolve, reject) => {
// Check for fire