Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Orange pie Orange Pi 4 development board how to use python to control GPIO under Ubuntu system

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how the orange pie Orange Pi 4 development board uses python to control GPIO under the Ubuntu system. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Orange pie Orange Pi 4 development board is equipped with Ruixin Micro Rockchip RK3399's 6-core ARM ®64-bit processor, with dual-channel 4GB LPDDR4 memory, on-board 16GB EMMC flash storage, support for Android 8.1, Ubuntu 16.04, Debian 9 and other operating systems, support for dual camera input, dual mipi lcd interface, support for two video output at the same time. In addition to MIPI-CSI dual camera interface, HDMI2.0 video output interface, microphone port, 3.5mm and HDMI2.0 audio output port, gigabit Ethernet port, USB3.0,USB2.0,Type-C and other standard interfaces, there are debug serial port, 24pin PCIE interface, 40pin raspberry pie compatible extension port.

How to use Python to control GPIO in Ubuntu system.

1. Download OPi.GPIO

Git clone https://github.com/baiywt/OPi.GPIO.git

2. Installation

Apt install python3-pip

Cd OPi.GPIO

Python3 setup.py install

3. Testing

Create a new file test_gpio.py

Import time

Import sys

Import OPi.GPIO as GPIO

Import orangepi.pi4

BOARD = orangepi.pi4.BOARD

GPIO.setmode (BOARD)

Pin=int (sys.argv [1])

GPIO.setup (pin, GPIO.OUT)

While True:

GPIO.output (pin, GPIO.HIGH)

Time.sleep (1)

GPIO.output (pin, GPIO.LOW)

Time.sleep (1)

Cd..

Python3 test_gpio.py 16 / / controls the physical pin to flip the level once in 16 1 seconds

Thank you for reading! On the "orange pie Orange Pi 4 development board in the Ubuntu system how to use python to control GPIO" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report