ADC operation

[!Note]

  1. Currently only SV50P series modules support this function.
  2. Before use, you need to enable the ADC function in Module Configuration and upgrade with the new system package generated before it can be used normally.
  3. More Usage Tutorial

Introduce header files

  #include "utils/AdcHelper.h"

Specific operation

  #include "utils/AdcHelper.h"

  static void testAdc() {
    /**
     * Set the adc enable state
     *
     * @param true enable
     *        false forbidden 
     *        The default is the enabled state
     */
    AdcHelper::setEnable(true);

    for (int i = 0; i < 10; i++) {
      // Read adc value
      int val = AdcHelper::getVal();
      LOGD("adc val = %d\n", val);
    }
  }
powered by Gitbooklast modified: 2021-05-28 12:00:31

results matching ""

    No results matching ""