12_rotaryEncoder.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:SunFounder_Super_Kit_V3.0_for_Raspberry_Pi 作者: sunfounder 项目源码 文件源码
def setup():
    global counter
    global Last_RoB_Status, Current_RoB_Status
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(RoAPin, GPIO.IN)
    GPIO.setup(RoBPin, GPIO.IN)
    GPIO.setup(RoSPin,GPIO.IN, pull_up_down=GPIO.PUD_UP)
    # Set up a falling edge detect to callback clear
    GPIO.add_event_detect(RoSPin, GPIO.FALLING, callback=clear)

    # Set up a counter as a global variable
    counter = 0
    Last_RoB_Status = 0
    Current_RoB_Status = 0

# Define a function to deal with rotary encoder
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号