Arduino_AdvancedAnalog - AdvancedDAC.begin()

Initializes the DAC with the specified parameters. To reconfigure the DAC, stop() must be called first.

Syntax

dac.begin(resolution, frequency, n_samples, n_buffers)

Parameters

  • enum - resolution (can be 8, 10, 12 bits).
    • AN_RESOLUTION_8
    • AN_RESOLUTION_10
    • AN_RESOLUTION_12
  • int - frequency - the output frequency in Hertz, e.g. 8000.
  • 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.

Returns

1 on success, 0 on failure.