ESP32U code problem {moisture sensor} in arduino IDE ambient

Hi,

I too have struggled with this board. The documentation implies that GPIO numbers are used to reference pins, whereas it appears that the NANO numbers are to be used instead. I have tried to get the onboard RGB to work and the example given using pins 46, 0 & 45 does not work, but using 14, 15 & 16 does.

Pin 46 does not produce an invalid pin error which does not help. Prefixing the NANO number with 'D' produces an error message for 'pins' greater than 12. I have not tried Analog pins yet, but. assume an 'A' prefix is required.

Your code appears to reference NANO pin numbers as well as GPIO numbers in different places, if I read it right. This is probably the main issue with your code if it works on other boards.

It is possible that A4-A7 may not work correctly if WiFi is in use.

It would be nice if GPIO numbers could be used as well as NANO numbers, in the manner of ESP8266 boards.

Good luck!