Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #LED ON
- import time, RPi.GPIO as GPIO
- GPIO.setmode(GPIO.BOARD)
- GPIO.setup(5,GPIO.OUT)
- GPIO.setwarnings(False)
- GPIO.output(5, True)
- time.sleep(1)
- #LED OFF
- import time, RPi.GPIO as GPIO
- GPIO.setmode(GPIO.BOARD)
- GPIO.setup(5,GPIO.OUT)
- GPIO.setwarnings(False)
- GPIO.output(5, False)
- time.sleep(1)
- #LED BLINK
- import time, RPi.GPIO as GPIO
- GPIO.setmode(GPIO.BOARD)
- GPIO.setup(5,GPIO.OUT)
- GPIO.setwarnings(False)
- while True:
- GPIO.output(5, False)
- time.sleep(1)
- GPIO.output(5, True)
- time.sleep(1)
- <?php
- if (isset($_POST['on']))
- {
- exec("sudo killall python");
- exec("sudo python /var/www/ledon.py");
- }
- else if (isset($_POST['off']))
- {
- exec("sudo killall python");
- exec("sudo python /var/www/ledoff.py");
- }
- else if (isset($_POST['blink']))
- {
- exec("sudo python /var/www/ledblink.py");
- }
- ?>
- <html>
- <style type="text/css">
- //Button colour is now yellow and size has been changed
- #form{font: bold 30px/30px Georgia, serif;}
- button{background: #512607 ; width:
- 200px; height: 100px;border: none;border: 3px solid black;borderradius:20px;}
- #container{margin0px; auto;width:80%;min-width:40%;}
- </style>
- <body>
- <div id="container">
- <form id="form" method="post">
- <center>
- <h1>Internet of Things over LAN</h1>
- <br> <button name="on"><h1>Led ON</h1></button><br>
- <button name="off"><h1>Led OFF</h1></button><br>
- <button name="blink"><h1>Led BLINK</h1></button>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement