#include <stdio.h>
#include <stdlib.h>
#include "esp_adc/adc_oneshot.h"
#include "esp_adc/adc_cali.h"
#include "esp_adc/adc_cali_scheme.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_log.h"
#include "esp_err.h"
#include "pin_defs.h"
Go to the source code of this file.
◆ ADC_ATTEN
#define ADC_ATTEN ADC_ATTEN_DB_11 |
◆ ADC_BITWIDTH_LEN
#define ADC_BITWIDTH_LEN ADC_BITWIDTH_12 |
◆ adc_handle_t
◆ enable_adc1()
esp_err_t enable_adc1 |
( |
adc_obj_t ** |
adc_obj | ) |
|
call function config_adc1() and characterize_adc1().
- Returns
- esp_err_t - returns ESP_OK if Configuration and Characterization of adc1 is successful, else it returns ESP_ERR_INVALID_ARG.
◆ read_adc()
Reads the adc value from the GPIO(channel) specified.
- Parameters
-
adc_handle_t | adc_handle - pointer to adc object. |
int | gpio - gpio pin number of the channel to be read. |
- Returns
- int - returns the adc value read from the channel.