Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.12 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>Servo Controller</title>
  4. </head>
  5.  
  6. <body>
  7.     Servo 1:
  8.     <form method="get" action="servphp.php">
  9.         <input type="submit" value="1000 Pulsewidth" name="1">
  10.         <input type="submit" value="1500 Pulsewidth" name="2">
  11.         <input type="submit" value="2000 Pulsewidth" name="3">
  12.         <input type="submit" value="2250 Pulsewidth" name="4">
  13.         <input type="submit" value="2400 Pulsewidth" name="5">
  14.     </form>
  15. <?php
  16. if(isset($_GET['1'])){
  17.     $gpio_on = shell_exec("pigs s 17 1000");
  18.     echo "Servo is at 1000 pulsewidth";
  19.     }
  20. else if(isset($_GET['2'])){                                    
  21.     $gpio_on = shell_exec("pigs s 17 1500");
  22.     echo "Servo is at 1500 pulsewidth";
  23.     }
  24. else if(isset($_GET['3'])){
  25.     $gpio_on = shell_exec("pigs s 17 2000");
  26.     echo "Servo is at 2000 pulsewidth";
  27.     }
  28. else if(isset($_GET['4'])){
  29.     $gpio_on = shell_exec("pigs s 17 2250");
  30.     echo "Servo is at 2250 pulsewidth";
  31.     }
  32. else if(isset($_GET['5'])){
  33.     $gpio_on = shell_exec("pigs s 17 2400");
  34.     echo "Servo is at 2400 pulsewidth";
  35.     }
  36. ?>
  37.     </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement