raspberry pi_使用Raspberry Pi和GPIO引脚控制外部LED

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母对公跳线

GPIO引脚配置

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值