Search found 1 match

by wukong
Fri Oct 04, 2019 2:08 pm
Forum: ESP-IDF 中文讨论版
Topic: ESP32 Arduino 读取ADC速度问题?
Replies: 1
Views: 6199

ESP32 Arduino 读取ADC速度问题?

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)); } //输出结果...