ESP32-ADC
时间:20200901
测试条件:使用ESP32WORM32D模组,SENSOR_VP作为ADC引脚
API相关
adc1_config_width(ADC_WIDTH_BIT_12); // 配置ADC宽度,ADC1是12位SARADC
adc1_config_channel_atten(ADC1_CHANNEL_0,ADC_ATTEN_DB_2_5); //配置引脚\配置ADC的基准电压,读取的电压不要超过基准<选取1.34V>
########################################
typedef enum {
ADC_ATTEN_DB_0 = 0, /*!<The input voltage of ADC will be reduced to about 1/1 */
ADC_ATTEN_DB_2_5 = 1, /*!<The input voltage of ADC will be reduced to about 1/1.34 */
ADC_ATTEN_DB_6 = 2, /*!<The input voltage of ADC will be reduced to about 1/2 */
ADC_ATTEN_DB_11 = 3, /*!<The input voltage of ADC will be reduced to about 1/3.6*/
ADC_ATTEN_MAX,
} adc_atten_t;
#####################################