(RaspBerry Pi) Python GPIO 基本操作
目前打算由潛入深慢慢學習RaspBerry Pi, 所以先由最容易下手的Python進入樹莓派的世界
首先要使用 GPIO 需要利用RPI.GPIO package想當然爾必須先安裝
所以先執行下列命令進行安裝
sudo apt-get install rpi.gpio
則可以使用的IO可以透過下列命令檢查, 可以得到IO相關狀態
gpio readall

最後附上GPIO H/L的簡易程式, 相關說明可以超聯結這裡 RPi.GPIO module basics
import RPi.GPIO as GPIO
import time pin = 4 GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.OUT) for i in range(0, 5):
GPIO.output(pin, True)
time.sleep(1)
GPIO.output(pin, False)
time.sleep(1) GPIO.cleanup()
(RaspBerry Pi) Python GPIO 基本操作的更多相关文章
- 树莓派 Raspberry PI之GPIO
树莓派 Raspberry PI之GPIO 树莓派各版本硬件原理图:https://www.raspberrypi.org/documentation/hardware/raspberrypi/REA ...
- 【Raspberry pi+python+mysql】红外传感器-发邮件-存数据库
1.mysql http://dev.mysql.com/doc/refman/5.5/en/tutorial.html mysql+python http://dev.mysql.com/doc/c ...
- 【Raspberry pi】GPIO注意事项
1.GPIO编码的方法 第三列是树莓派板子上的自然编号(左边引脚为1-15,右边引脚为2-26),RPi.GPIO.setmode(GPIO.BOARD)采用这列编号 树莓派主芯片提供商Broadco ...
- 【Raspberry pi】GPIO使用指南
http://www.cnblogs.com/qtsharp/archive/2013/02/28/2936800.html 树莓派RaspberryPi的RPi.GPIO使用指南 Python操 ...
- Raspberry Pi 3 --- GPIO control
Before input 'gpio readall', need install wiringPi download "wiringPi":git clone git://git ...
- Raspberry Pi使用
1. 介绍 笔者Raspberry Pi 2 Model B为例介绍 1.1 参数 Raspberry Pi 2 Model B硬件参数如下: · Broadcom BCM2836 900MHz 4核 ...
- Raspberry Pi & GPIO
Raspberry Pi & GPIO pinout === pin out / p in out pi@raspberrypi:~ $ pinout ,------------------- ...
- Raspberry Pi I2C驱动 (Python)
本文参考 http://www.instructables.com/id/Raspberry-Pi-I2C-Python/all/?lang=zh 作者 AntMan232 In this instr ...
- Pi# - Raspberry Pi GPIO Library for .NET
Project Description Pi# (pronounced “Pi Sharp”) is a library to expose the GPIO functionality of the ...
随机推荐
- [Training Video - 2] [Groovy Introduction]
Building test suites, Test cases and Test steps in SOAP UI Levels : test step level test case level ...
- abp CrudAppService 自定义分页、排序
public class GetAllTasksInput : PagedAndSortedResultRequestDto { public TaskState? State { get; set; ...
- js去掉字符串前后空格的五种方法(转)
出处:http://www.2cto.com/kf/201204/125943.html 第一种:循环检查替换[javascript]//供使用者调用 function trim(s){ retu ...
- UVa 11297 Census (二维线段树)
题意:给定上一个二维矩阵,有两种操作 第一种是修改 c x y val 把(x, y) 改成 val 第二种是查询 q x1 y1 x2 y2 查询这个矩形内的最大值和最小值. 析:二维线段树裸板. ...
- 使用phpStorm编辑器进行PHP代码的xdebug调试
首先需要安装Xdebug,如果没有安装可以查看PHP断点调试工具Xdebug的安装这篇文章.phpStorm是开发者经常用的一款编辑器,当然也支持Xdebug调试,下面说一下配置步骤. phpStor ...
- java文件的读写程序代码
package textopen; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutp ...
- jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version
jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version , 取而代之的是 $.support . 在更新的 2.0 版本中,将不再支持 IE 6/7/8. ...
- Linux 基础教程 42-xargs命令
xargs是execute arguments的缩写,主要作用是从标准输入中读取内容,并将此内容传递给它要协助的命令,并作为要协助命令的参数来执行. 基本语法 xargs [选项] [命令] ...
- asp.net部署时加密config文件
1:运行cmd,并定位到C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727(可以直接运行vs2005的命令提示工具,但是貌似vs2010默认指向的framewo ...
- EBS11i - 常用Profile
Profile Name 说明 设置建议 FND: Enable Cancel Query 当执行一个超长时间的查询时,会出现一个 Cancel窗口,允许用户取消.比如我们在SO 界面没有输入条件 ...