Hello,
I see a code on internet to correct the ADC.
This code need to know wich version of ESP32 is used.
The part of code is:
//ADC Calibration
#if CONFIG_IDF_TARGET_ESP32
#define ADC_EXAMPLE_CALI_SCHEME ESP_ADC_CAL_VAL_EFUSE_VREF
#elif CONFIG_IDF_TARGET_ESP32S2
#define ADC_EXAMPLE_CALI_SCHEME ESP_ADC_CAL_VAL_EFUSE_TP
#elif CONFIG_IDF_TARGET_ESP32C3
#define ADC_EXAMPLE_CALI_SCHEME ESP_ADC_CAL_VAL_EFUSE_TP
#elif CONFIG_IDF_TARGET_ESP32S3
#define ADC_EXAMPLE_CALI_SCHEME ESP_ADC_CAL_VAL_EFUSE_TP_FIT
#endif
These define are not available to the Arduino developpement.
I need similar define to build my code.
Can you tell me how I can found SOC define in Arduino env ?
Many thanks !
soc version needed for analog read linearisation
-
- Posts: 8
- Joined: Fri Mar 30, 2018 4:38 pm
Re: soc version needed for analog read linearisation
Code: Select all
#include "sdkconfig.h"
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: soc version needed for analog read linearisation
Code: Select all
#include <Arduino.h>
-
- Posts: 828
- Joined: Mon Jul 22, 2019 3:20 pm
Re: soc version needed for analog read linearisation
There are already APIs included in Arduino and ESP-IDF to abstract this. Don't reinvent the wheel with something that will be difficult to maintain.
https://github.com/espressif/arduino-es ... adc.c#L269
https://docs.espressif.com/projects/esp ... alibration
https://github.com/espressif/arduino-es ... adc.c#L269
https://docs.espressif.com/projects/esp ... alibration
Who is online
Users browsing this forum: No registered users and 96 guests