move vars to .env
This commit is contained in:
parent
d27d34665b
commit
be54f6f769
8
main.js
8
main.js
@ -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();
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user