Manage multiple motor pins in motheure-simple/source/loop
This commit is contained in:
parent
59103b79f9
commit
e7a7596aac
|
@ -145,12 +145,16 @@
|
|||
|
||||
/* [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');
|
||||
/* (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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue