• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

arduino的SAMD21G18内置AD的采样率多少?

mingming 2021-07-05 浏览量:448
这家介绍该MCU内置AD通过函数可以控制至12位
(请手工把点替换成.)链接:dronebotworkshop点com/seeeduino-xiao-intro/
  1. // Analog Input Pin
  2. #define ANALOG_IN_PIN A2

  3. // Integer to represent input value
  4. int input_val;

  5. void setup()
  6. {
  7.   // Set A/D converter resolution to 12-bits
  8.   analogReadResolution(12);
  9.   
  10.   // Setup Serial Port
  11.   SerialUSB.begin(9600);
  12. }

  13. void loop()
  14. {
  15.   // Read the input value
  16.   input_val = analogRead(ANALOG_IN_PIN);  
  17.   
  18.   
  19.   // Print value to Serial Monitor
  20.   SerialUSB.println(input_val);
  21.   
  22.   // Slight delay before repeating
  23.   delay(10);
  24.   
  25. }
m data-ke-onclick="copycode($('code_vfN'));">复制代码
摘录:You can experiment with the analogReadResolution function and set it to different values to see the result. If set to 10 (or if the statement is eliminated) the output will range from 0 to 1023.


是否说明采样率0~1023 SPS ?
找了一圈,没找到怎么控制采样率





0 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
所有亮答 数量:0

相关问题

问题达人换一批

arduino的SAMD21G18内置AD的采样率多少?