From aa7377ede2c889c73348f9136a7398dfb450cf45 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 21 Feb 2017 16:35:39 +0100 Subject: [PATCH] [Fixed] Set to low (because not set to OUT mode if already so doesn't set to LOW by default) --- lib/chip/source/state.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/chip/source/state.php b/lib/chip/source/state.php index 5740f5d..d8dc0ae 100755 --- a/lib/chip/source/state.php +++ b/lib/chip/source/state.php @@ -68,11 +68,10 @@ foreach($g_state as $pinIndex=>$pinValue){ // set value to HIGH if not 0 // - if( $pinValue !== 0 ){ - - if( syscall(SOURCE_DIR."/lib/gpio/high ".$g_pins[$pinIndex]) == false ) - return 127; - } + if( $pinValue !== 0 ) + syscall(SOURCE_DIR."/lib/gpio/high ".$g_pins[$pinIndex]); + else + syscall(SOURCE_DIR."/lib/gpio/low ".$g_pins[$pinIndex]); }