Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to implement GPIO pin driver for raspberry pie

Shulou Source: shulou.com Published: 2022-06-01 22:56:00 10月01日 Update

This article mainly introduces how to realize GPIO pin driver of Raspberry Pi. The introduction in this article is very detailed and has certain reference value. Interested friends must read it!

Preparations:

Raspberry Pi development board installed with respbian system, mouse, keyboard, HDMI cable

LED lights, resistors, breadboards, wires

Build the circuit:

The circuit is very simple. It is to drive the LED lamp with the gpio of the Raspberry Pi. According to the GPIO pin distribution diagram of the Raspberry Pi, the LED lamp is connected in series with a current limiting resistor, one section is connected to the GPIO pin, and one end is grounded.

My LED is connected to pin 7, i.e. BCM4, and the ground is connected to pin 39. After the circuit is built, it is to write a program to drive the LED to light up.

Open Python 3

Create a new file, add the code below, save, and run

Click Run module,

You can see the LED lights on.

If it lights up properly, you can also add more functions, blink, and you can connect more circuits and achieve more functions.

The above is all the content of this article "How to implement GPIO pin driver on Raspberry Pi", thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Tags: Raspberry driver more circuit content function that is article run one end following figure code value interest distribution map wire guy buddy lap file Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MySQL OPPO Reno NVidia Shulou Technology