(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 ...
随机推荐
- 监测IIS上网站的连接数
1.运行,输入,perfmon.msc 2.性能监视器>右侧区域>右键 添加计数器 3.在“可用计数器” 区域,选择Web Service,展开Web Service,选择Current ...
- JAVA array,map 转 json 字符串
public class User { private String username; private String password; public String getUsername() { ...
- android studio使用真机测试时点击Debug调试模式时报Error running app:No target device found,点击运行模式却是启动正常的
原因是adb没检测到设备(包括真机和虚拟机). 在Terminal执行adb devices命令,查看有没有连接到的设备. 如果没有设备,确认虚拟机是否正确打开,真机是否连接打开USB调试并安装驱动. ...
- 注解Annotation补充介绍
摘抄http://www.cnblogs.com/peida/archive/2013/04/23/3036035.html 什么是注解(Annotation): Annotation(注解)就是Ja ...
- selenium 元素可以定位到,但是无法点击问题
报错1: selenium.common.exceptions.WebDriverException: Message: Element is not clickable at point (82, ...
- C#之Dictionary 与 C++之map
最近重学二叉查找树,顺便就好好看了看C#里Dictionary和C++的map的实现原理. 首先简单说明两个基本数据结构: 1. 散列表 散列表是一个key-value数据结构,可根据key值直接访问 ...
- [Erlang26]怎么通过beam文件得到所有的record或源代码?
怎么通过beam文件得到所有的record或源代码? 1. 首先必须要在compile里面加上debug_info信息: 1 > c(load,[debug_info]). {ok,load ...
- PD生成SQL脚本附带注释命令
'------------------------------------------------------------''脚本功能:' PowerDesigner中批量根据对象的name生成com ...
- jQuery限制文本框的输入长度
jQuery限制文本框输入,包含粘贴. //限制文本框的输入长度 $(function () { $(document).on("keypress", ".txt-val ...
- Katalon Studio简单使用(一)
官网地址:https://www.katalon.com/ katalon 目前有两种产品 一个是studio 另外一个是katalon analytics,此处先来学习studio部分. 文章学习内 ...