From 82241614768a57a2d7e4776e2f92a4aece37ee99 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 24 Nov 2024 15:20:13 -0500 Subject: [PATCH] Add emergency auger loop --- src/_EMR/main.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/_EMR/main.js diff --git a/src/_EMR/main.js b/src/_EMR/main.js new file mode 100644 index 0000000..d02d86c --- /dev/null +++ b/src/_EMR/main.js @@ -0,0 +1,16 @@ +// Import modules +const gpio = require('./custom_modules/VoidGPIO.js'); +const config = require('./custom_modules/config.json'); +const fn = require('./custom_modules/functions.js'); + +// Auger Loop +setInterval(fn.routines.cycleAuger, 2000); + +fn.log('Setting exhaust to low to keep NC relay closed and fan running'); +gpio.setPin(process.pinMap.get('exhaust').board, 0); + +process.on('SIGINT', () => { + fn.log(`Exiting gracefully...`); + gpio.setPin(process.pinMap.get('auger').board, 0); + process.exit(); +}); \ No newline at end of file