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

    ADC Pins

    Scheduled Pinned Locked Moved LoPy
    4 Posts 2 Posters 1.4k 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.
    • M Offline
      mo-seph
      last edited by

      I'm trying to use the ADC, and I don't understand the pinout/library setup.

      I'm using this code, from an example I found (but it seems in line with the docs at https://docs.pycom.io/pycom_esp32/library/machine.ADC.html):

      adc = ADC(0)
      adc_c = adc.channel(pin='P13')
      

      This seems to read pin 5, which as far as I can tell is GPIO 36 and ADC1_0 - what does P13 mean, an how can I figure out what to put in for other pins? If I try 'P5', which would make logical sense, it throws an exception. From the pinout, it seems that they are sort of the same but not really?

      Also, it's a real shame that AREF is not available - it would be nice to be able to plug in a potentiometer and have it work, without faffing around with voltage dividers

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @mo-seph
        last edited by livius

        @mo-seph said in ADC Pins:

        This seems to read pin 5, which as far as I can tell is GPIO 36 and ADC1_0 - what does P13 mean, an how can I figure out what to put in for other pins? If I try 'P5', which would make logical sense, it throws an exception. From the pinout, it seems that they are sort of the same but not really?

        https://docs.pycom.io/pycom_esp32/pycom_esp32/datasheets.html

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • M Offline
          mo-seph
          last edited by

          Yup, I've got the pinout sheet - I don't know how to decode it. There's one physical pin, with G5 next to it on the expansion board. The pinout lists: 5, GPIO36, ADCPA, ADC1_0, RTCIO0, SensVP and P13 next to it. 5 and P13 are both coloured as a physical pin. What's the deal? It seems confusing!

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @mo-seph
            last edited by

            @mo-seph
            I always write 'PXX'
            but you have right this is confusing

            think about people first, then computers

            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