Page 1 of 1

ESP32 Arduino 读取ADC速度问题?

Posted: Fri Oct 04, 2019 2:08 pm
by wukong
void setup() {
Serial.begin(115200);
}

void loop() {

unsigned long begt = 0, begt2 = 0, runt = 0;
int v1 = 0;

begt = micros();//记录开始微秒数

for (unsigned long i = 0; i < 1000000; i++)
{
v1 = analogRead(32);
}

begt2 = micros();//记录结束微秒数
runt = begt2 - begt; //计算用时

Serial.println(String(runt));
}



//输出结果大约 10,000,000
//即读取模拟值 {v1 = analogRead(32);} 的时间约为10微秒
//我现在的问题就是想加快这个速度,10微秒太慢了,要如何改进呢?

Re: ESP32 Arduino 读取ADC速度问题?

Posted: Fri Nov 08, 2019 3:02 am
by ESP_Gargamel
Arduino 问题,建议到 Arduino 板块进行提问。