raspberry pi
by Shahbaz Ahmed
Shahbaz艾哈迈德(Shahbaz Ahmed)
使用Raspberry Pi和GPIO引脚控制外部LED (Controlling an External LED using a Raspberry Pi and GPIO pins)
In this post we’ll explore Raspberry Pi GPIO pins by creating a “Hello World” GPIO program that results in a blinking red LED. We’ll be using the Python programming language. I am using a headless Raspberry Pi Zero WH (wireless with soldered headers) with Raspbian Stretch Lite (Raspberry Pi operating system with a minimal image based on Debian Stretch).
在本文中,我们将通过创建“ Hello World” GPIO程序来探索Raspberry Pi GPIO引脚,该程序会导致红色LED闪烁。 我们将使用Python编程语言。 我在Raspbian Stretch Lite(Raspberry Pi操作系统,基于Debian Stretch的最小映像)上使用了无头Raspberry Pi零WH(无线和焊接头)。
I will talk to my headless Pi using ssh
and transfer necessary files from my Mac to Pi using scp
commands. I am assuming you have your Raspberry Pi up and running with Raspbian OS installed. If not, then there are lot of articles on the Internet describing how to setup your Pi and install Raspbian, including the official Raspberry Pi documentation.
我将使用ssh
与无头Pi交谈,并使用scp
命令将必要的文件从Mac传输到Pi。 我假设您已经安装了Raspberry Pi并运行了Raspbian OS。 如果没有,那么Internet上有很多文章介绍如何设置Pi和安装Raspbian,包括官方的Raspberry Pi文档 。
Things you’ll need:
您需要做的事情:
- 1 x Raspberry Pi (I am using the Pi Zero WH model) 1 x Raspberry Pi(我使用的是Pi Zero WH模型)
- 1 x bread board 1个面包板
- 1 x red LED light 1个红色LED灯
- 1 x 330 ohm resistor 1个330欧姆电阻
- 2 x female to male jumper cable 2 x母对公跳线