单片机/MCU论坛
直播中

李艺银

7年用户 971经验值
私信 关注
[问答]

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


  • // Analog Input Pin
  • #define ANALOG_IN_PIN A2

  • // Integer to represent input value
  • int input_val;

  • void setup()
  • {
  •   // Set A/D converter resolution to 12-bits
  •   analogReadResolution(12);

  •   // Setup Serial Port
  •   SerialUSB.begin(9600);
  • }

  • void loop()
  • {
  •   // Read the input value
  •   input_val = analogRead(ANALOG_IN_PIN);


  •   // Print value to Serial Monitor
  •   SerialUSB.println(input_val);

  •   // Slight delay before repeating
  •   delay(10);

  • }


更多回帖

发帖
×
20
完善资料,
赚取积分