• Recent
    • Docs
    • Github
    • 百度网盘
    • Onedrive
    • Official
    • Shop
    • Register
    • Login

    为什么控制不了输出电平

    Scheduled Pinned Locked Moved Pi CM5
    2 Posts 2 Posters 310 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      weiweiwei
      last edited by

      我用下面这个代码可以正常运行,还可以打印出0和1,甚至我去pin=40对应的gpio115文件中的value中也能看到0和1的变化,但对应的引脚始终是高电平3.3V
      import CPi.GPIO as GPIO
      import time

      PIN = 40

      GPIO.setmode(GPIO.BOARD)
      GPIO.setup(PIN, GPIO.OUT)

      while True:
      GPIO.output(PIN, 0)
      time.sleep(1)
      print(0)
      GPIO.output(PIN, 1)
      time.sleep(1)
      print(1)

      J 1 Reply Last reply Reply Quote 0
      • J
        jack_admin @weiweiwei
        last edited by

        @weiweiwei 这个是匹配4b板

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post