diff --git a/src/_EMR/ign_off.js b/src/_EMR/ign_off.js index 36cc10d..7d483fd 100644 --- a/src/_EMR/ign_off.js +++ b/src/_EMR/ign_off.js @@ -3,5 +3,15 @@ const gpio = require('../custom_modules/VoidGPIO.js'); const config = require('../custom_modules/config.json'); const fn = require('../custom_modules/functions.js'); -fn.log('Turning on igniter'); -gpio.setPin(process.pinMap.get('igniter').board, 0); \ No newline at end of file +// Variables +process.pinMap = new Map(); + +fn.log('Initializing pinMap', 'DEBUG'); +for (const pin of config.pins) { + process.pinMap.set(pin.key, pin); +} + +fn.log('Turning off igniter', 'INFO'); +gpio.setPin(process.pinMap.get('igniter').board, 0); +fn.log('Igniter off', 'INFO'); +process.exit(); \ No newline at end of file diff --git a/src/_EMR/ign_on.js b/src/_EMR/ign_on.js index a77c980..f3cf72a 100644 --- a/src/_EMR/ign_on.js +++ b/src/_EMR/ign_on.js @@ -3,5 +3,15 @@ const gpio = require('../custom_modules/VoidGPIO.js'); const config = require('../custom_modules/config.json'); const fn = require('../custom_modules/functions.js'); -fn.log('Turning on igniter'); -gpio.setPin(process.pinMap.get('igniter').board, 1); \ No newline at end of file +// Variables +process.pinMap = new Map(); + +fn.log('Initializing pinMap', 'DEBUG'); +for (const pin of config.pins) { + process.pinMap.set(pin.key, pin); +} + +fn.log('Turning on igniter', 'INFO'); +gpio.setPin(process.pinMap.get('igniter').board, 1); +fn.log('Igniter on', 'INFO'); +process.exit(); \ No newline at end of file