This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| exec("sudo python enciendeled.py"); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <?php | |
| if (isset($_POST['LedON'])) | |
| { | |
| exec('sudo python /var/www/html/raspduino/enciendeled.py'); | |
| } | |
| if (isset($_POST['LedOFF'])) | |
| { | |
| exec('sudo python /var/www/html/raspduino/apagaled.py'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import serial | |
| arduino = serial.Serial('/dev/ttyACM0', 9600) | |
| arduino.write("H") #Mandar un comando hacia Arduino | |
| print('LED ENCENDIDO') | |
| arduino.close() #Finalizamos la comunicacion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import serial | |
| arduino = serial.Serial('/dev/ttyACM0', 9600) | |
| while True: | |
| arduino.write("H") #Mandar un comando hacia Arduino | |
| arduino.close() #Finalizamos la comunicacion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import serial | |
| arduino = serial.Serial('/dev/ttyACM0', 9600) | |
| arduino.write("H") #Mandar un comando hacia Arduino |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import serial | |
| arduino = serial.Serial('/dev/ttyACM0', 9600) | |
| arduino.write("L") #Mandar un comando hacia Arduino | |
| arduino.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| print "HOLA MUNDO; Soy Python me han llamado desde PHP" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $output = array(); | |
| exec("python /var/www/html/PRUEBASPHP/holamundo.py", $output); | |
| echo $output[0]; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <?php | |
| if (isset($_POST['LedON'])) | |
| { | |
| $output = array(); | |
| exec("python /var/www/html/raspduino/enciendeled.py", $output); | |
| echo $output[0]; | |
| } | |
| if (isset($_POST['LedOFF'])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| import serial | |
| arduino = serial.Serial('/dev/ttyACM0', 9600) | |
| while True: | |
| print "LED encendido" | |
| arduino.write("H") #Mandar un comando hacia Arduino | |
| # arduino.close() #Finalizamos la comunicacion |