B4R Question ESp32 Analog Range Enhancements

Discussion in 'B4R Questions' started by rodmcm, Sep 15, 2018.

  1. rodmcm

    rodmcm Member Licensed User

    Feature Request
    Would it be possible some time to have the more advanced features of the ADC on the ESP32 available on B4r?
    This video shows the possibilities and the very handy linearisation formula for a 0-4095 count
    YouTube - Tech Note 069 - Using the ESP32 ADC and some of its more advanced functions
  2. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Of course, B4R has all the functions, since the analog converters are the same configuration as an Arduino.
  3. viriato

    viriato Member Licensed User

    Do you have an B4R example reading ESP32 ADC pins ?
  4. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    BillMeyer likes this.
  5. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    These are the most common ADC pins in ESP32

    Attached Files:

  6. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Keep in mind that the following Pins are:
    Vp = pin 36
    Vn = pin 39
    Until pin 13 are ADC, all those pins I have tested and they work
    All you have to do is change the Pin number
    A0.Initialize(36,A0.MODE_INPUT)' pin ADC 35...
    Here I attach this example, which also comes with an example of how to use the full ESP32 PWM. I hope and it is useful.
    Any question, I will be here to order

    Attached Files:

  7. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Here is an image of ESP32 and its pins

    Attached Files:

  8. viriato

    viriato Member Licensed User

    Great , this is going to help
    Gracias , Many thanks
    Johan Hormaza likes this.
  9. canalrun

    canalrun Well-Known Member Licensed User

    I'm going to hijack this thread - even though it is 2 months old. :D

    I am starting with the ESP32 ADC. You mention "Of course, B4R had all the functions ..." referring to the YouTube video.

    How would one access, for example, the AnalogSetWidth() function?

    Can this be done from B4R? Is there an h file or library that must be included?

  10. Erel

    Erel Administrator Staff Member Licensed User

    Should be simple to call with inline C.

    #if C
    void AnalogSetWidth(B4R::Object* o) {
    #End if
    RunNative("AnalogSetWidth", Null)
    canalrun and Johan Hormaza like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice