/var/www/newpipe "); } else if($_GET['button'] == "start"){ shell_exec("echo \"3, ". date("H:i:s"). substr((string)microtime(), 1, 4) ."\" > /var/www/newpipe "); } for ($i=0; $i < count($gpio); $i++){ if($_GET['button'] == "HIGH_" . $gpio[$i][0]) { shell_exec("echo \"4, ". $gpio[$i][1] .", ". date("H:i:s"). substr((string)microtime(), 1, 4) ."\" > /var/www/newpipe "); } else if($_GET['button'] == "LOW_" . $gpio[$i][0]) { shell_exec("echo \"5, ". $gpio[$i][1] .", ". date("H:i:s"). substr((string)microtime(), 1, 4) ."\" > /var/www/newpipe "); } else if($_GET['button'] == "READ_" . $gpio[$i][0]) { $modeon = trim(@shell_exec("/usr/local/bin/gpio -g mode " . $gpio[$i][0] . " in")); $val = trim(@shell_exec("/usr/local/bin/gpio -g read " . $gpio[$i][0] )); echo $val; } // PMWE = PWM_EIN PWMA = PWM_AUS.....erwartetes format: zustand, pin, frequenz, dc else if($_GET['button'] == "PWME_" . $gpio[$i][0]){ # $myfile = fopen("/var/www/newpipe", "a") or die("Unable to open file!"); # #um doppeltes einschalten zu vermeiden wird zuerst ausgeschaltet # $txt = "0, " . $gpio[$i][1] . ", " . $_GET['fq'] . ", " . $_GET['dc']; # fwrite($myfile, $txt); # fclose($myfile); # shell_exec("echo \"0, " . $gpio[$i][1] . ", " . $_GET['fq'] . ", " . $_GET['dc']."\" > /var/www/newpipe "); # shell_exec("echo \"0, 8, 1, " . $_GET['dc']\" > /var/www/newpipe "); # #einschalten # $myfile = fopen("/var/www/newpipe", "a") or die("Unable to open file!"); # $txt = "1, " . $gpio[$i][1] . ", " . $_GET['fq'] . ", " . $_GET['dc']; # fwrite($myfile, $txt); # fclose($myfile); shell_exec("echo \"1, " . $gpio[$i][1] . ", " . $_GET['fq'] . ", " . $_GET['dc']. ", " . date("H:i:s"). substr((string)microtime(), 1, 4) ."\" > /var/www/newpipe "); } else if($_GET['button'] == "PWMA_" . $gpio[$i][0]){ # $myfile = fopen("/var/www/newpipe", "a") or die("Unable to open file!"); # $txt = "0, " . $gpio[$i][1] . ", " . $_GET['fq'] . ", " . $_GET['dc']; # fwrite($myfile, $txt); # fclose($myfile); shell_exec("echo \"0, " . $gpio[$i][1] . ", " . $_GET['fq'] . ", " . $_GET['dc']. ", " . date("H:i:s"). substr((string)microtime(), 1, 4) ."\" > /var/www/newpipe "); } } ?>