ADC on Wemos S2

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
thewifimaster
Posts: 9
Joined: Fri Oct 08, 2021 5:37 pm

ADC on Wemos S2

Post by thewifimaster » Fri Oct 08, 2021 5:42 pm

Hi

As it is my first post after doing lots of passive reading here, thanks for MicroPython and a great community / forum!

I just got a Wemos S2 and am trying to get the ADC(1) to work. As I see in the docs it should work on GPIOs 32 - 39, but all of them throw a 'ValueError: invalid Pin for ADC'. Has anyone tried this? Am I missing something?

I used the v1.16 build as proposed by Wemos.

thewifimaster
Posts: 9
Joined: Fri Oct 08, 2021 5:37 pm

Re: ADC on Wemos S2

Post by thewifimaster » Tue Oct 26, 2021 9:02 pm

So I tried loading different (unstable) versions of v1.17 but they do not seem to work at all, not sure what type of custom build Lolin created here. Does anyone know how to get the latest version to work?

As an example, I get the following when loading esp32-20211026-unstable-v1.17-112-g9519484c5.bin:

Code: Select all

Unexpected chip id in image. Expected 2 but value was 0. Is this image for a different chip model?
And as far as I can tell, it made it into the official repository and should therefore be within the latest builds?

thewifimaster
Posts: 9
Joined: Fri Oct 08, 2021 5:37 pm

Re: ADC on Wemos S2

Post by thewifimaster » Tue Oct 26, 2021 10:43 pm

So I took this as a challenge and went ahead to build my own binary for v1.17 which did work out. Unfortunately ADC still does not work, and, seems to be broken. Any hints, anyone?

Code: Select all

MicroPython v1.17-112-g9519484c5 on 2021-10-27; LOLIN_S2_MINI with ESP32-S2FN4R2
Type "help()" for more information.
>>> 

thewifimaster
Posts: 9
Joined: Fri Oct 08, 2021 5:37 pm

Re: ADC on Wemos S2

Post by thewifimaster » Tue Jan 18, 2022 9:43 pm

Wo RTFM helps: use GPIOs starting with 1 and that's where you get a working ADC1.

Post Reply