Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>LED Control</title>
- </head>
- <body>
- LED Control:
- <form method="get" action="index.php">
- <input type="submit" value="ON" name="on">
- <input type="submit" value="OFF" name="off">
- </form>
- <?php
- $setmode17 = shell_exec("/usr/local/bin/gpio mode 7 out");
- if(isset($_GET['on'])){
- while (1){
- $gpio_on = shell_exec("/usr/local/bin/gpio write 7 1");
- echo "LED is on";
- sleep(1);
- $gpio_off = shell_exec("/usr/local/bin/gpio write 7 0");
- echo "LED is off";
- sleep(1);
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement