move vars to .env

This commit is contained in:
Skylar Grant 2022-11-26 20:50:20 -05:00
parent d27d34665b
commit be54f6f769

View File

@ -1,4 +1,6 @@
var gpio = require('rpi-gpio'); var gpio = require('rpi-gpio');
var dotenv = require('dotenv').config();
gpio.setup(7, gpio.DIR_OUT, cycleAuger); gpio.setup(7, gpio.DIR_OUT, cycleAuger);
function augerOn(err) { function augerOn(err) {
@ -35,11 +37,9 @@ function sleep(ms) {
async function cycleAuger(err) { async function cycleAuger(err) {
if (err) throw err; if (err) throw err;
const offTime = 1000; //ms
const onTime = 500; //ms
augerOn(); augerOn();
await sleep(onTime); await sleep(process.env.ONTIME);
augerOff(); augerOff();
await sleep(offTime); await sleep(process.env.OFFTIME);
cycleAuger(); cycleAuger();
} }