Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Servo Controller</title>
- </head>
- <body>
- Servo 1:
- <form method="get" action="servphp.php">
- <input type="submit" value="1000 Pulsewidth" name="1">
- <input type="submit" value="1500 Pulsewidth" name="2">
- <input type="submit" value="2000 Pulsewidth" name="3">
- <input type="submit" value="2250 Pulsewidth" name="4">
- <input type="submit" value="2400 Pulsewidth" name="5">
- </form>
- <?php
- if(isset($_GET['1'])){
- $gpio_on = shell_exec("pigs s 17 1000");
- echo "Servo is at 1000 pulsewidth";
- }
- else if(isset($_GET['2'])){
- $gpio_on = shell_exec("pigs s 17 1500");
- echo "Servo is at 1500 pulsewidth";
- }
- else if(isset($_GET['3'])){
- $gpio_on = shell_exec("pigs s 17 2000");
- echo "Servo is at 2000 pulsewidth";
- }
- else if(isset($_GET['4'])){
- $gpio_on = shell_exec("pigs s 17 2250");
- echo "Servo is at 2250 pulsewidth";
- }
- else if(isset($_GET['5'])){
- $gpio_on = shell_exec("pigs s 17 2400");
- echo "Servo is at 2400 pulsewidth";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement