Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

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);

https://mongoose-os.com/docs/api/mgos_adc.h.html indicates that

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

functions.

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 ?

Thanks

Paul

Comments

Sign In or Register to comment.