Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

Read ADC compile failure

pjapja Cambridge

I am attempting to compile some code that reads an analog voltage via an esp32 ADC pin

Compile fails when I include the following code

include "mgos_adc.h"


mgos_adc_enable(36); //ADC1_0
int adc_val = mgos_adc_read(36); indicates that

include "mgos_adc.h" should contain the prototypes of these


The compile (mos build --local --verbose --platform=esp32) fails with

make[1]: Leaving directory '/opt/Espressif/esp-idf/components/bootloader/subproject'
/media/scratch/git_repos/mgos_wifi_dev_template/src/wifi.c:5:22: fatal error: mgos_adc.h: No such file or directory

On further inspection mgos_adc.h is not found in the local build path

mos version info

pja@e6410:/media/scratch/git_repos/mgos_wifi_dev_template$ mos --version
The Mongoose OS command line tool
Version: 2.0
Build ID: 2.0+4ed5853~xenial0
Update channel: release

Is there something I'm missing ?




  • nliviunliviu Romania

    Did you add the adc library to the libs of your mos.yml?

     - origin:
  • pjapja Cambridge

    Nope, and when I it compiled fine.

    Thanks for your advice.


Sign In or Register to comment.