ADC Pins



  • 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



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



  • 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!



  • @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


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.