diff --git a/Readme.md b/Readme.md index 57761e0..fe04dd3 100644 --- a/Readme.md +++ b/Readme.md @@ -65,6 +65,12 @@ Para prender o apagar el LED, se deshabilita el trigger y se modifica el registr En el caso del parpadeo del LED, el trigger se modifica para activar el timer y se utilizan los registro de *delay_on* y *delay_off* para establecer el tiempo de encendido y apagado. + + +Si el usuario no conoce los comandos, puede usar ***help*** para desplegar la lista de +los comandos anteriormente mencionados, o bien al ingresar un comando erróneo +saldrá una alerta que indicará que el comando es incorrecto y mostrará todos los +comandos a usar. ```python if sys.argv[1] == "on": @@ -82,8 +88,18 @@ elif sys.argv[1] == "blink": writeLED("/trigger", "timer") writeLED("/delay_on", "500") writeLED("/delay_off", "500") +elif sys.argv[1] == "help": + print("This is an application to control User LED 3") + print("List of commands: ") + print("on - Powers on the LED") + print("off - Powers off the LED") + print("blink - Makes the LED blink") else: - print("Wrong command!!!") + print("Error: This is not a command for this application") + print("These are the commands you can use: ") + print("on - Powers on the LED") + print("off - Powers off the LED") + print("blink - Makes the LED blink") print("Script done") ``` @@ -91,14 +107,26 @@ print("Script done") ## Ejecución -Se cambian los permisos de nuestro script. +Para poder ejecutar nuestra aplicación se asigna los permisos necesarios con el +siguiente comando: ```bash sudo chmod u+x led.py ``` -Y se ejecuta con cualquiera de los argumentos mencionados anteriormente. +Y se ejecuta con cualquiera de los argumentos disponibles. + +Encender el LED +```bash +sudo ./led.py on +``` + +APagar el LED +```bash +sudo ./led.py off +``` +Parpadear el LED ```bash sudo ./led.py blink ``` \ No newline at end of file diff --git a/led.py b/led.py index 8a4a1b2..bd8dd68 100755 --- a/led.py +++ b/led.py @@ -37,7 +37,17 @@ elif sys.argv[1] == "blink": writeLED("/trigger", "timer") writeLED("/delay_on", "500") writeLED("/delay_off", "500") +elif sys.argv[1] == "help": + print("This is an application to control User LED 3") + print("List of commands: ") + print("on - Powers on the LED") + print("off - Powers off the LED") + print("blink - Makes the LED blink") else: - print("Wrong command!!!") + print("Error: This is not a command for this application") + print("These are the commands you can use: ") + print("on - Powers on the LED") + print("off - Powers off the LED") + print("blink - Makes the LED blink") print("Script done")