Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Can I use Pins to connect external buttons and LED's?

    Scheduled Pinned Locked Moved Expansion Board
    lopyexpansion boardpinsbutton
    3 Posts 2 Posters 925 Views 2 Watching
    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.
    • C Offline
      cooper
      last edited by

      Would it be possible to connect an external button as well as an external LED light to the expansion board? I'm hoping to connect a LoPy4 as well as a few buttons to the expansion board but I'm unsure if this is supported. Are there open pins I can use for general purposes like this?

      Are there any tutorials on working with the pins? It doesn't look like the LoPy documentation has much there unless I'm missing something.

      1 Reply Last reply Reply Quote 0
      • P Offline
        Prawnhead
        last edited by

        Hey Cooper, the part in the documentation you need is 6.2.1.4 Pin. This gives you the basics of running an LED from a pin or using a button as an input.

        If you connect a button between a pin and ground (0V) then you need to configure the pin with a pull-up resistor. Vice-versa works too: a button between the pin and 3.3V with a PULL_DOWN on the pin.

        p_in = Pin('P10', mode=Pin.IN, pull=Pin.PULL_UP)
        

        When you connect an LED to a pin you need a resistor in series with the LED. 220ohms should work.

        When you look at the LoPy Pinout Diagram all those pins marked as GPIOxx can be a button input or LED output. So you can use lots!

        • Chris.
        C 1 Reply Last reply Reply Quote 0
        • C Offline
          cooper @Prawnhead
          last edited by

          @prawnhead thank you! That's exactly what I needed to know :)

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom