HOME > Components > Raspberry Pi: Control Gpio Pins - This Is How It's Easy

Raspberry Pi: Control GPIO pins - this is how it's easy

The newer Raspberry Pis have a 40-head pin header on which there are so-called input-output pins (GPIO). You can control these GPIOs with your smartphone, for example, and thus control various things in your household.

How are the GPIOs controlled?

Every Raspberry Pi nowadays has input-output pins (GPIOs). These can be controlled with a program or app to control other devices or LEDS.
  1. For the setup you need a Raspberry Pi, a small LED, a 330 Ohm resistor and 4 Male to Male jumper cables.
  2. The LED has a longer end. Plug this end into the breadboard in the right direction.
  3. Now plug the jumper cable into a hole under the longer LED connector and connect the other side to GPIO 23 on your Raspberry Pi.
  4. Now plug a 330 ohm resistor under the other side of the LED and plug the other end further left into the breadboard. Attach a jumper cable underneath the resistor plugged in on the left and connect it to ground on your Raspberry Pi.
  5. Open the Python console on your PC and type "import RPi.GPIO as GPIO", "import time". Furthermore, enter the command "GPIO.setmode(GPIO.BCM)".
  6. Now define GPIO 23 as output. „GPIO.setup(23, GPIO.OUT)“.
  7. Nun können Sie die LED mit folgenden Befehlen an- beziehungsweise ausschalten: „GPIO.output(23, GPIO.HIGH)“, „GPIO.output(23, GPIO.LOW).

By Vullo

Football Manager 2020: Which leagues are included? :: Mount & Blade 2: Bannerlord - what to expect
USEFUL LINKS