diff --git a/main.js b/main.js index c1c4d22..11f003a 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,5 @@ var gpio = require('rpi-gpio'); -gpio.setup(7, gpio.DIR_OUT, write); +gpio.setup(7, gpio.DIR_OUT, cycleAuger); function augerOn(err) { if (err) throw err; @@ -33,7 +33,8 @@ function sleep(ms) { }); } -async function cycleAuger() { +async function cycleAuger(err) { + if (err) throw err; const offTime = 1500; //ms const onTime = 500; //ms augerOn(); @@ -41,6 +42,4 @@ async function cycleAuger() { augerOff(); await sleep(offTime); cycleAuger(); -} - -cycleAuger(); \ No newline at end of file +} \ No newline at end of file