From e7a7596aac543d0d5bdc8266f44363707c825e69 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 14 Oct 2017 16:29:48 +0200 Subject: [PATCH] Manage multiple motor pins in motheure-simple/source/loop --- feature/motheure-simple/source/loop.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/feature/motheure-simple/source/loop.php b/feature/motheure-simple/source/loop.php index bfbd749..e683213 100644 --- a/feature/motheure-simple/source/loop.php +++ b/feature/motheure-simple/source/loop.php @@ -145,10 +145,14 @@ /* [2] Set up GPIO pin =========================================================*/ - /* (1) Set as input */ - if( !syscall(SOURCE_DIR."/lib/gpio/in $MOTOR_PIN") ){ - slog('Cannot set up motor pin as INPUT', 'motheure-simple:setup'); - return 127; + /* (1) Set all inputs as inputs */ + foreach($MOTOR_PIN as $PIN){ + + if( !syscall(SOURCE_DIR."/lib/gpio/in $PIN") ){ + slog("Cannot set up motor pin $PIN as INPUT", 'motheure-simple:setup'); + return 127; + } + }