Arduino_AdvancedAnalog - AdvancedADCDual.begin()

Initializes and starts the two ADCs with the specified parameters.

Syntax

adc_dual.begin(resolution, sample_rate, n_samples, n_buffers)

Parameters

  • enum - resolution the sampling resolution (can be 8, 10, 12, 14 or 16 bits).
    • AN_RESOLUTION_8
    • AN_RESOLUTION_10
    • AN_RESOLUTION_12
    • AN_RESOLUTION_14
    • AN_RESOLUTION_16
  • int - sample_rate - the sampling rate / frequency in Hertz, e.g. 16000.
  • int - n_samples - the number of samples per sample buffer. See SampleBuffer for more details.
  • int - n_buffers - the number of sample buffers in the queue. See SampleBuffer for more details.
  • enum - sample_time - the sampling time in cycles (the default is 8.5 cycles).
    • AN_ADC_SAMPLETIME_1_5
    • AN_ADC_SAMPLETIME_2_5
    • AN_ADC_SAMPLETIME_8_5
    • AN_ADC_SAMPLETIME_16_5
    • AN_ADC_SAMPLETIME_32_5
    • AN_ADC_SAMPLETIME_64_5
    • AN_ADC_SAMPLETIME_387_5
    • AN_ADC_SAMPLETIME_810_5

Returns

1 on success, 0 on failure.