IO18 cannot read analog signals( ESP32-WROOM-32E)

Issue #421 resolved
YongYu created an issue

Hi, John. Have you been busy lately? It is currently being tested with Longan Core (core is ESP32-WROOM-32E). Found that IO18 cannot read analog signals. Whether this is a limitation on the firmware. I want to set IO16, 17, 18, 23 to both digital and analog interfaces, so that students do not have to distinguish between digital and analog interfaces. Or do you have any good suggestions?

Comments (9)

  1. John Maloney repo owner

    From the ESP32 pinout, it looks as though pin 18 of the ESP32 is not capable of reading analog.

    Any of the pins marked ADC-1 or ADC-2 on the pinout can be used to read analog. (ADC = Analog to Digital Converter). Unfortunately, none of pins you list (IO16, 17, 18, 23) have ADCs, thus the cannot read analog values. That is a hardware limitation. Are there other pins that you can use for analog on the Longan Core?

  2. John Maloney repo owner

    GPIO Pins 0, 2, 4, 12-15, 25-27, 32-36, 39 are capable of analog input. Those pins are all capable of digital input. Pins 34-39 are input only, which means that they cannot be used as outputs, but they can be used to read either analog or digital sensors.

    I hope the Longan Core makes some of those pins available.

  3. YongYu reporter

    That is to say, GPIO ports 0, 2, 4, 12-15, 25-27, 32,33 have analog output, input, and digital input and output capabilities, right?

  4. YongYu reporter

    We also want to replace the motor and steering gear with IIC communication, do you have a recommended digital interface IIC driver chip?

  5. John Maloney repo owner

    MicroBlocks has libraries for products that is IIC motor and servo control chips (e.g. Wukong board, Cutebot car) but I am not sure what chip is used in those products. However, the IIC commands for such chips are usually fairly simple so it easy to create a MicroBlocks library for them.

    As an example, you could look at the code for the Wukong "set motor" block. To see the code for a library block, right-click on the block and select "see block definition"

  6. Log in to comment