Hello World del GPIO con Bash Once assembled circuit, we do what I call a “Hello World GPIO” in Bash executing the following script. #!/bin/bash #Exportamos el puerto GPIO 17 echo 17 > /sys/class/gpio/export #Lo configuramos como salida echo out > /sys/class/gpio/gpio17/direction #Encendemos el LED asignandole 1 como valor lógico echo 1 > /sys/class/gpio/gpio17/value To turn off the LED we can do the following script. #!/bin/bash #Apagamos el LED asignandole 0 como valor lógico echo 0 > /sys/class/gpio/gpio17/value #Eliminamos la entrada del puerto GPIO 17 echo 17 > /sys/class/gpio/unexport Basically what we are doing with Bash is to create a directory hierarchy in /sys/class/gpio and add content to each file that will be sought after as a variable. jerarquia Hierarchy within the / sys / class / gpio. Introduction to Python We have found that our circuit works correctly and LED has gone on to give a logic high value to the variable, Now let's see how we can do the same in python, which will allow us to schedule our web applications to control inputs and outputs GPIO from any device.

Raspberry PI and GPIO pin: Controlling an LED with Bash and Python

To this effect a LED, resistor 330 ohmnios, Wire, and protoboard, or tin and a soldering. Also need our Raspberry tenga yes Raspbian preinstalled, if not your case, you can see how to do it in the following link directory. Mounting the circuit You can solder directly LED the wire and resistance as you will …

Raspberry PI and GPIO pin: Controlling an LED with Bash and Python Continue Reading