Last day I did some changes in my Rust code and it worked almost perfectly
#[main]
fn main() -> ! {
let mut adc1_config = AdcConfig::new();
let pin = adc1_config.enable_pin_with_cal::<GpioPin<4>, AdcCalBasic<ADC1>>(hw_390_pin, Attenuation::_11dB);
let adc1 = Adc::new(peripherals.ADC1, adc1 ...
Search found 2 matches
- Thu Mar 06, 2025 7:15 am
- Forum: ESP-IDF
- Topic: ESP32C6 ADC not working properly
- Replies: 9
- Views: 9381
- Wed Feb 26, 2025 7:13 am
- Forum: ESP-IDF
- Topic: ESP32C6 ADC not working properly
- Replies: 9
- Views: 9381
Re: ESP32C6 ADC not working properly
Based on my tests in C and Rust, the problem occurs in Rust esp-hal.
If code in C language has DEFAULT_VREF set to 1100 problem should not occur.
#include <Arduino.h>
#include "driver/adc.h"
#define DEFAULT_VREF 1100
#define ADC_PIN A4
// Define the ADC channel and attenuation
#define ADC ...
If code in C language has DEFAULT_VREF set to 1100 problem should not occur.
#include <Arduino.h>
#include "driver/adc.h"
#define DEFAULT_VREF 1100
#define ADC_PIN A4
// Define the ADC channel and attenuation
#define ADC ...