上拉电阻和下拉电阻 All In One
上拉电阻和下拉电阻 All In One
电路图
图解
上拉电阻和下拉电阻
电路图
http://tinyurl.com/y4lhftvj
#!/usr/bin/env python3
# coding: utf8
import RPi.GPIO as GPIO
import time
# 指定 BCM 模式下的 GPIO 针脚编号是 12
# 对应的物理针脚编号是 32
PIN_IN = 12
PIN_OUT = 16
# BCM 模式
GPIO.setmode(GPIO.BCM)
# ...
# 指定 GPIO 针脚为一个电流输出针脚
GPIO.setup(PIN_OUT, GPIO.OUT)
普通电阻
# 指定 GPIO 针脚为一个电流输入针脚
GPIO.setup(PIN_IN, GPIO.IN)
上拉电阻
# ⬆️ 使用上拉电阻
GPIO.setup(PIN_IN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
下拉电阻
# ⬇️ 使用下拉电阻
GPIO.setup(PIN_IN, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
demos
https://youtu.be/74s5CpyG5ts?t=464
https://youtu.be/k_GAuSONCqo?t=8
tools
Interactive
Electronic Circuit
Simulator / 交互式电子电路
模拟器
http://lushprojects.com/
RPi Low-level peripherals / RPi 底层外设
https://elinux.org/RPi_Low-level_peripherals
http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/gpio-pin-electrical-specifications#rpi-gpio-input-voltage-and-output-current-limitations
refs
树莓派
GPIO
引脚大全
©xgqfrms 2012-2021
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
未经授权禁止转载,违者必究!