Sorry about total newbie question…so far worked only with Arduino.
I’m trying to read ADC in “disco_l072cz_lrwan1” board (STM32 based) and regular analogReference(INTERNAL) isn’t recognized by compiler.
How do I define I want to use internal reference voltage?
platform = ststm32
board = disco_l072cz_lrwan1
framework = arduino
lib_deps = stm32duino/STM32duino Low Power@^1.2.0
Looks like the
analogReference() function isn’t used. From
* \brief Configures the reference voltage used for analog input (i.e. the value used as the top of the input range).
* This function is kept only for compatibility with existing AVR based API.
* \param ulMmode Should be set to AR_DEFAULT.
extern void analogReference(eAnalogReference ulMode) ;
void analogReference(eAnalogReference ulMode)
It would appear that you must use
AR_DEFAULT when calling
It compiles with `analogReference(AR_DEFAULT).
But where do I have to go to find out what reference voltage/source is defined by AR_DEFAULT?
Didn’t find any “default” condition for ADC from these docs:
Possibly here: analogReference() - Arduino Reference
Also, https://deepbluembedded.com/stm32-adc-tutorial-complete-guide-with-examples/#_STM32_ADC_Resolution_Reference_Formulas, where it seems to indicate that it’s 3.3V unless your development board has VREF tied to a lower voltage than 3.3V.