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

    How to understand Pin.ALT

    Scheduled Pinned Locked Moved Discussion
    pin.alt
    4 Posts 2 Posters 1.6k 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.
    • L Offline
      livius
      last edited by

      Hi,

      what does it mean if i write something like this?

      Pin('GP16', mode=Pin.ALT, pull=Pin.PULL_DOWN)
      

      i see this in
      https://github.com/danicampora/wipy-WS2812/blob/master/ws2812.py

      think about people first, then computers

      1 Reply Last reply Reply Quote 0
      • M Offline
        mmarkvoort
        last edited by

        @livius

        I found this on the docs.micropython website:

        The Pin class allows to set an alternate function for a particular pin, but it does not specify any further operations on such a pin. Pins configured in alternate-function mode are usually not used as GPIO but are instead driven by other hardware peripherals.

        See here for more information.

        L 1 Reply Last reply Reply Quote 0
        • L Offline
          livius @mmarkvoort
          last edited by livius

          @mmarkvoort

          near to understand but looking at maping rules:

          	LED/USB
          RST		5V
          P0 - G2		GND
          P1 - G1		3,3V
          P2 - G23	P23 - G10
          P3 - G24	P22 - G9
          P4 - G11	P21 - G8
          CLK - G12	P20 - G7
          MOSI - G13	P19 - G6
          MISO - G14	P18 - G30
          P8 - G15	P17 - G31
          P9 - G16	P16 - G3
          P10 - G17	P15 - G0
          P11 - G22	P14 - G4
          P12 - G28	P13 - G5
          

          and description about SPI default pins:

          # this uses the SPI default pins for CLK, MOSI and MISO (``P10``, ``P11`` and ``P12``)
          

          i do not understand why GP16? not e.g. GP17?

          Pin('GP16', mode=Pin.ALT, pull=Pin.PULL_DOWN)
          

          GP16 = P9 which is not default pin for SPI
          or maybe this driver is not for Wipy2 only Wipi1.0
          if this is true then now i am back understand this clearly :)

          think about people first, then computers

          M 1 Reply Last reply Reply Quote 0
          • M Offline
            mmarkvoort @livius
            last edited by

            @livius

            Ah, I understand what you mean.
            Don't know this either...

            But I think it is indeed for WiPy 1.0
            On this image it says GP16 is MOSI.
            I found the image according to this forum post.

            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